summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorSteve Bennetts <steve@lindenlab.com>2009-10-26 23:41:18 -0700
committerSteve Bennetts <steve@lindenlab.com>2009-10-26 23:41:18 -0700
commitc0abbb6a648778f2acfaabd4e70763c0e31f7790 (patch)
treee88aa904d5f89cbc4933636858033ed05c4743a4 /indra
parent4272cc6956b21f77326b0c6bbbbc4be37e7f6fad (diff)
Fixed a crash on exit in gInventory destructor.
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/llappviewer.cpp4
-rw-r--r--indra/newview/llinventorymodel.cpp11
-rw-r--r--indra/newview/llinventorymodel.h4
3 files changed, 15 insertions, 4 deletions
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index 923a66ee8e..840fa542bd 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -1350,7 +1350,9 @@ bool LLAppViewer::cleanup()
// Destroy the UI
if( gViewerWindow)
gViewerWindow->shutdownViews();
-
+
+ gInventory.cleanupInventory();
+
// Clean up selection managers after UI is destroyed, as UI may be observing them.
// Clean up before GL is shut down because we might be holding on to objects with texture references
LLSelectMgr::cleanupGlobals();
diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp
index d5a527773c..e49be83fbc 100644
--- a/indra/newview/llinventorymodel.cpp
+++ b/indra/newview/llinventorymodel.cpp
@@ -176,12 +176,19 @@ LLInventoryModel::LLInventoryModel()
// Destroys the object
LLInventoryModel::~LLInventoryModel()
{
+ cleanupInventory();
+}
+
+void LLInventoryModel::cleanupInventory()
+{
empty();
for (observer_list_t::iterator iter = mObservers.begin();
- iter != mObservers.end(); ++iter)
+ iter != mObservers.end(); )
{
- delete *iter;
+ LLInventoryObserver* observer = *iter++;
+ delete observer;
}
+ mObservers.clear();
}
// This is a convenience function to check if one object has a parent
diff --git a/indra/newview/llinventorymodel.h b/indra/newview/llinventorymodel.h
index 7d4f3372e9..d51460b374 100644
--- a/indra/newview/llinventorymodel.h
+++ b/indra/newview/llinventorymodel.h
@@ -112,7 +112,9 @@ public:
// construction & destruction
LLInventoryModel();
~LLInventoryModel();
-
+
+ void cleanupInventory();
+
class fetchInventoryResponder : public LLHTTPClient::Responder
{
public: