Newer
Older
/**
* @file llmortician.cpp
*
* Copyright (c) 2005-$CurrentYear$, Linden Research, Inc.
* $License$
*/
#include "llmortician.h"
#include <list>
std::list<LLMortician*> gGraveyard;
BOOL LLMortician::sDestroyImmediate = FALSE;
LLMortician::~LLMortician()
{
gGraveyard.remove(this);
}
void LLMortician::updateClass()
{
while (!gGraveyard.empty())
{
LLMortician* dead = gGraveyard.front();
delete dead;
}
}
void LLMortician::die()
{
// It is valid to call die() more than once on something that hasn't died yet
if (sDestroyImmediate)
{
Aaron Brashears
committed
// *NOTE: This is a hack to ensure destruction order on shutdown.