From 3fc3773ab848ff7fcfcb40c61e211ee13592f418 Mon Sep 17 00:00:00 2001
From: Richard Nelson <none@none>
Date: Fri, 25 Jun 2010 14:57:42 -0700
Subject: EXT-7991 FIX Crash if exit before outfit autopopulate completes
 reviewed by Leyla

---
 indra/newview/llagentwearablesfetch.cpp |  2 +-
 indra/newview/llviewerinventory.cpp     | 15 +++++++++++++++
 indra/newview/llviewerinventory.h       |  9 +++++++--
 3 files changed, 23 insertions(+), 3 deletions(-)

(limited to 'indra')

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; }
 };
-- 
cgit v1.2.3


From 18224f89047ab580e4bcb41e29bcb18f815410b2 Mon Sep 17 00:00:00 2001
From: Richard Nelson <none@none>
Date: Fri, 25 Jun 2010 15:43:31 -0700
Subject: EXT-8079 -  [crashhunters] Crash in LLImagePreviewAvatar::`scalar
 deleting destructor' reviewed by Palmer

---
 indra/newview/llvoavatar.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'indra')

diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h
index 4259bb8e73..3d0fe9e0fe 100644
--- a/indra/newview/llvoavatar.h
+++ b/indra/newview/llvoavatar.h
@@ -865,7 +865,7 @@ private:
 public:
 	// Responsible for detecting the user's voice signal (and when the
 	// user speaks, it puts a voice symbol over the avatar's head) and gesticulations
-	LLVoiceVisualizer*  mVoiceVisualizer;
+	LLPointer<LLVoiceVisualizer>  mVoiceVisualizer;
 	int					mCurrentGesticulationLevel;
 
 	//--------------------------------------------------------------------
-- 
cgit v1.2.3