diff options
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/llappviewer.cpp | 1 | ||||
-rw-r--r-- | indra/newview/llviewerobjectlist.cpp | 3 | ||||
-rw-r--r-- | indra/newview/llvoavatarself.cpp | 11 | ||||
-rw-r--r-- | indra/newview/llvoavatarself.h | 1 |
4 files changed, 13 insertions, 3 deletions
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index a8d69a38cd..8eab4bf508 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -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. diff --git a/indra/newview/llviewerobjectlist.cpp b/indra/newview/llviewerobjectlist.cpp index 5e0bd5b811..752aeaaab0 100644 --- a/indra/newview/llviewerobjectlist.cpp +++ b/indra/newview/llviewerobjectlist.cpp @@ -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); diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index d58be21910..06c9af6c2f 100644 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -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(); } /** diff --git a/indra/newview/llvoavatarself.h b/indra/newview/llvoavatarself.h index 3c7ec04fab..4960d4d103 100644 --- a/indra/newview/llvoavatarself.h +++ b/indra/newview/llvoavatarself.h @@ -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(); |