From d0695ee11e3a4843b6022c0b0c9b781ade4b51da Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Tue, 25 Oct 2011 12:48:40 -0700
Subject: [PATCH] EXP-1465 FIX Crash in IM panel destructor

---
 indra/newview/llimfloatercontainer.cpp | 3 ++-
 indra/newview/llimfloatercontainer.h   | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/indra/newview/llimfloatercontainer.cpp b/indra/newview/llimfloatercontainer.cpp
index 33cb3a54a7c..c8e48b0d428 100644
--- a/indra/newview/llimfloatercontainer.cpp
+++ b/indra/newview/llimfloatercontainer.cpp
@@ -47,12 +47,13 @@ LLIMFloaterContainer::LLIMFloaterContainer(const LLSD& seed)
 
 LLIMFloaterContainer::~LLIMFloaterContainer()
 {
+	mNewMessageConnection.disconnect();
 	LLTransientFloaterMgr::getInstance()->removeControlView(LLTransientFloaterMgr::IM, this);
 }
 
 BOOL LLIMFloaterContainer::postBuild()
 {
-	LLIMModel::instance().mNewMsgSignal.connect(boost::bind(&LLIMFloaterContainer::onNewMessageReceived, this, _1));
+	mNewMessageConnection = LLIMModel::instance().mNewMsgSignal.connect(boost::bind(&LLIMFloaterContainer::onNewMessageReceived, this, _1));
 	// Do not call base postBuild to not connect to mCloseSignal to not close all floaters via Close button
 	// mTabContainer will be initialized in LLMultiFloater::addChild()
 	return TRUE;
diff --git a/indra/newview/llimfloatercontainer.h b/indra/newview/llimfloatercontainer.h
index 53dfcd78ff1..892ecef48d1 100644
--- a/indra/newview/llimfloatercontainer.h
+++ b/indra/newview/llimfloatercontainer.h
@@ -62,7 +62,7 @@ class LLIMFloaterContainer : public LLMultiFloater
 private:
 	typedef std::map<LLUUID,LLFloater*> avatarID_panel_map_t;
 	avatarID_panel_map_t mSessions;
-
+	boost::signals2::connection mNewMessageConnection;
 
 	void onNewMessageReceived(const LLSD& data);
 };
-- 
GitLab