summaryrefslogtreecommitdiff
path: root/indra/newview/llinventorymodel.cpp
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/newview/llinventorymodel.cpp
parent4272cc6956b21f77326b0c6bbbbc4be37e7f6fad (diff)
Fixed a crash on exit in gInventory destructor.
Diffstat (limited to 'indra/newview/llinventorymodel.cpp')
-rw-r--r--indra/newview/llinventorymodel.cpp11
1 files changed, 9 insertions, 2 deletions
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