From 47a5e1c751bb8dfccef65ee841749d8209106c99 Mon Sep 17 00:00:00 2001 From: Stinson Linden Date: Thu, 5 Jun 2014 23:15:43 +0100 Subject: MAINT-4009: Ensuring that the local bitmaps are cleaned up on app exit. --- indra/newview/lllocalbitmaps.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'indra/newview/lllocalbitmaps.cpp') diff --git a/indra/newview/lllocalbitmaps.cpp b/indra/newview/lllocalbitmaps.cpp index 1948475530..e78e0233d7 100755 --- a/indra/newview/lllocalbitmaps.cpp +++ b/indra/newview/lllocalbitmaps.cpp @@ -824,6 +824,12 @@ LLLocalBitmapMgr::~LLLocalBitmapMgr() { } +void LLLocalBitmapMgr::cleanupClass() +{ + std::for_each(sBitmapList.begin(), sBitmapList.end(), DeletePointer()); + sBitmapList.clear(); +} + bool LLLocalBitmapMgr::addUnit() { bool add_successful = false; -- cgit v1.2.3 From bde6023286c899c99104b16181203f7b58819333 Mon Sep 17 00:00:00 2001 From: Stinson Linden Date: Fri, 6 Jun 2014 19:28:18 +0100 Subject: MAINT-4137: Correcting some poorly written CPP code that could potentially lead to problems in the future. --- indra/newview/lllocalbitmaps.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview/lllocalbitmaps.cpp') diff --git a/indra/newview/lllocalbitmaps.cpp b/indra/newview/lllocalbitmaps.cpp index e78e0233d7..92587a911a 100755 --- a/indra/newview/lllocalbitmaps.cpp +++ b/indra/newview/lllocalbitmaps.cpp @@ -190,7 +190,7 @@ bool LLLocalBitmap::updateSelf(EUpdateType optional_firstupdate) { // decode is successful, we can safely proceed. LLUUID old_id = LLUUID::null; - if (!(optional_firstupdate == UT_FIRSTUSE) && !mWorldID.isNull()) + if ((optional_firstupdate != UT_FIRSTUSE) && !mWorldID.isNull()) { old_id = mWorldID; } @@ -206,7 +206,7 @@ bool LLLocalBitmap::updateSelf(EUpdateType optional_firstupdate) gTextureList.addImage(texture); - if (!optional_firstupdate == UT_FIRSTUSE) + if (optional_firstupdate != UT_FIRSTUSE) { // seek out everything old_id uses and replace it with mWorldID replaceIDs(old_id, mWorldID); -- cgit v1.2.3 From 61f3bf8a4799016f6a50007314816cddb1dff030 Mon Sep 17 00:00:00 2001 From: Stinson Linden Date: Fri, 6 Jun 2014 19:30:41 +0100 Subject: MAINT-4137: Correcting a potential crash. This change should fix the most probable location of a callstack being reported by the crash reporter. However, there is no reproduction yet, so hard to test whether this actually patches the crash occcurrence. --- indra/newview/lllocalbitmaps.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'indra/newview/lllocalbitmaps.cpp') diff --git a/indra/newview/lllocalbitmaps.cpp b/indra/newview/lllocalbitmaps.cpp index 92587a911a..6d1a240ce5 100755 --- a/indra/newview/lllocalbitmaps.cpp +++ b/indra/newview/lllocalbitmaps.cpp @@ -213,8 +213,11 @@ bool LLLocalBitmap::updateSelf(EUpdateType optional_firstupdate) // remove old_id from gimagelist LLViewerFetchedTexture* image = gTextureList.findImage(old_id); - gTextureList.deleteImage(image); - image->unref(); + if (image != NULL) + { + gTextureList.deleteImage(image); + image->unref(); + } } mUpdateRetries = LL_LOCAL_UPDATE_RETRIES; -- cgit v1.2.3