EXT-6536 : Make LLVOAvatarSelf a singleton
Fix for cleaning up gAgentAvatar on app shutdown.meow-7.2.2
parent
b6e7850c0a
commit
0ffc73855b
|
|
@ -4085,6 +4085,7 @@ void LLAppViewer::disconnectViewer()
|
|||
gAgentCamera.cleanup();
|
||||
// Also writes cached agent settings to gSavedSettings
|
||||
gAgent.cleanup();
|
||||
delete gAgentAvatarp;
|
||||
|
||||
// This is where we used to call gObjectList.destroy() and then delete gWorldp.
|
||||
// Now we just ask the LLWorld singleton to cleanly shut down.
|
||||
|
|
|
|||
|
|
@ -949,7 +949,8 @@ void LLViewerObjectList::killAllObjects()
|
|||
{
|
||||
objectp = *iter;
|
||||
killObject(objectp);
|
||||
llassert(objectp->isDead());
|
||||
// Object must be dead, or it's the LLVOAvatarSelf which never dies.
|
||||
llassert((objectp == gAgentAvatarp) || objectp->isDead());
|
||||
}
|
||||
|
||||
cleanDeadObjects(FALSE);
|
||||
|
|
|
|||
|
|
@ -518,10 +518,17 @@ BOOL LLVOAvatarSelf::buildMenus()
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
LLVOAvatarSelf::cleanup()
|
||||
{
|
||||
markDead();
|
||||
delete mScreenp;
|
||||
mScreenp = NULL;
|
||||
mRegionp = NULL;
|
||||
}
|
||||
|
||||
LLVOAvatarSelf::~LLVOAvatarSelf()
|
||||
{
|
||||
delete mScreenp;
|
||||
mScreenp = NULL;
|
||||
cleanup();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -56,6 +56,7 @@ public:
|
|||
virtual ~LLVOAvatarSelf();
|
||||
virtual void markDead();
|
||||
virtual void initInstance(); // Called after construction to initialize the class.
|
||||
void cleanup();
|
||||
protected:
|
||||
/*virtual*/ BOOL loadAvatar();
|
||||
BOOL loadAvatarSelf();
|
||||
|
|
|
|||
Loading…
Reference in New Issue