summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Nelson <none@none>2010-06-25 14:57:42 -0700
committerRichard Nelson <none@none>2010-06-25 14:57:42 -0700
commit3fc3773ab848ff7fcfcb40c61e211ee13592f418 (patch)
tree60ef6e10f21fd36e9f451ea0b7a01cfdbe91aef7
parent1b9c357bc34ff3c52aaaaeff7c4503cce747ce7a (diff)
EXT-7991 FIX Crash if exit before outfit autopopulate completes
reviewed by Leyla
-rw-r--r--indra/newview/llagentwearablesfetch.cpp2
-rw-r--r--indra/newview/llviewerinventory.cpp15
-rw-r--r--indra/newview/llviewerinventory.h9
3 files changed, 23 insertions, 3 deletions
diff --git a/indra/newview/llagentwearablesfetch.cpp b/indra/newview/llagentwearablesfetch.cpp
index 0a2f0e9399..d911d123f4 100644
--- a/indra/newview/llagentwearablesfetch.cpp
+++ b/indra/newview/llagentwearablesfetch.cpp
@@ -48,7 +48,7 @@ public:
virtual ~LLOrderMyOutfitsOnDestroy()
{
- if (LLApp::isExiting())
+ if (!LLApp::isRunning())
{
llwarns << "called during shutdown, skipping" << llendl;
return;
diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp
index 3430f265ae..2bf05d5907 100644
--- a/indra/newview/llviewerinventory.cpp
+++ b/indra/newview/llviewerinventory.cpp
@@ -839,6 +839,21 @@ LLInventoryCallbackManager::~LLInventoryCallbackManager()
sInstance = NULL;
}
+//static
+void LLInventoryCallbackManager::destroyClass()
+{
+ if (sInstance)
+ {
+ for (callback_map_t::iterator it = sInstance->mMap.begin(), end_it = sInstance->mMap.end(); it != end_it; ++it)
+ {
+ // drop LLPointer reference to callback
+ it->second = NULL;
+ }
+ sInstance->mMap.clear();
+ }
+}
+
+
U32 LLInventoryCallbackManager::registerCB(LLPointer<LLInventoryCallback> cb)
{
if (cb.isNull())
diff --git a/indra/newview/llviewerinventory.h b/indra/newview/llviewerinventory.h
index d0d3ad693e..dc3d3f7423 100644
--- a/indra/newview/llviewerinventory.h
+++ b/indra/newview/llviewerinventory.h
@@ -36,6 +36,7 @@
#include "llinventory.h"
#include "llframetimer.h"
#include "llwearable.h"
+#include "llui.h" //for LLDestroyClass
#include <boost/signals2.hpp> // boost::signals2::trackable
@@ -299,8 +300,9 @@ private:
// misc functions
//void inventory_reliable_callback(void**, S32 status);
-class LLInventoryCallbackManager
+class LLInventoryCallbackManager : public LLDestroyClass<LLInventoryCallbackManager>
{
+ friend LLDestroyClass<LLInventoryCallbackManager>;
public:
LLInventoryCallbackManager();
~LLInventoryCallbackManager();
@@ -308,9 +310,12 @@ public:
void fire(U32 callback_id, const LLUUID& item_id);
U32 registerCB(LLPointer<LLInventoryCallback> cb);
private:
- std::map<U32, LLPointer<LLInventoryCallback> > mMap;
+ typedef std::map<U32, LLPointer<LLInventoryCallback> > callback_map_t;
+ callback_map_t mMap;
U32 mLastCallback;
static LLInventoryCallbackManager *sInstance;
+ static void destroyClass();
+
public:
static bool is_instantiated() { return sInstance != NULL; }
};