summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Antipov <mantipov@productengine.com>2009-12-01 19:42:42 +0200
committerMike Antipov <mantipov@productengine.com>2009-12-01 19:42:42 +0200
commit279942b7bf78483fb8b2866e79782cc7e1cf260e (patch)
tree37207c34b358626b19aee9f5ffb282bd07d27a76
parentdd262a7a3682c80d67908ab4b8f31660699e85e9 (diff)
Fixed critical bug EXT-2990 (Viewer crashes after openning "Voice Control" on IM floater)
-- added disconnecting from subscribed signals while destroying participant list -- added disconnecting from subscribed signals while destroying Voice controls -- added nullifying of the pointer to speaker manager when channel is changed --HG-- branch : product-engine
-rw-r--r--indra/newview/llcallfloater.cpp5
-rw-r--r--indra/newview/llcallfloater.h2
-rw-r--r--indra/newview/llparticipantlist.cpp10
-rw-r--r--indra/newview/llparticipantlist.h5
4 files changed, 18 insertions, 4 deletions
diff --git a/indra/newview/llcallfloater.cpp b/indra/newview/llcallfloater.cpp
index 1b929eca0e..7db709086f 100644
--- a/indra/newview/llcallfloater.cpp
+++ b/indra/newview/llcallfloater.cpp
@@ -54,6 +54,7 @@ LLCallFloater::LLCallFloater(const LLSD& key)
LLCallFloater::~LLCallFloater()
{
+ mChannelChangedConnection.disconnect();
delete mPaticipants;
mPaticipants = NULL;
}
@@ -77,7 +78,7 @@ BOOL LLCallFloater::postBuild()
updateSession();
// subscribe to to be notified Voice Channel is changed
- LLVoiceChannel::setCurrentVoiceChannelChangedCallback(boost::bind(&LLCallFloater::onCurrentChannelChanged, this, _1));
+ mChannelChangedConnection = LLVoiceChannel::setCurrentVoiceChannelChangedCallback(boost::bind(&LLCallFloater::onCurrentChannelChanged, this, _1));
return TRUE;
}
@@ -157,6 +158,8 @@ void LLCallFloater::refreshPartisipantList()
void LLCallFloater::onCurrentChannelChanged(const LLUUID& /*session_id*/)
{
+ // Forget speaker manager from the previous session to avoid using it after session was destroyed.
+ mSpeakerManager = NULL;
updateSession();
}
diff --git a/indra/newview/llcallfloater.h b/indra/newview/llcallfloater.h
index 8a440873ff..3112b8e81b 100644
--- a/indra/newview/llcallfloater.h
+++ b/indra/newview/llcallfloater.h
@@ -90,6 +90,8 @@ private:
LLParticipantList* mPaticipants;
LLAvatarList* mAvatarList;
EVoiceControls mVoiceType;
+
+ boost::signals2::connection mChannelChangedConnection;
};
diff --git a/indra/newview/llparticipantlist.cpp b/indra/newview/llparticipantlist.cpp
index 07a1214b4f..13f195a1be 100644
--- a/indra/newview/llparticipantlist.cpp
+++ b/indra/newview/llparticipantlist.cpp
@@ -64,10 +64,10 @@ LLParticipantList::LLParticipantList(LLSpeakerMgr* data_source, LLAvatarList* av
mSpeakerMgr->addListener(mSpeakerModeratorListener, "update_moderator");
mAvatarList->setNoItemsCommentText(LLTrans::getString("LoadingData"));
- mAvatarList->setDoubleClickCallback(boost::bind(&LLParticipantList::onAvatarListDoubleClicked, this, mAvatarList));
- mAvatarList->setRefreshCompleteCallback(boost::bind(&LLParticipantList::onAvatarListRefreshed, this, _1, _2));
+ mAvatarListDoubleClickConnection = mAvatarList->setDoubleClickCallback(boost::bind(&LLParticipantList::onAvatarListDoubleClicked, this, mAvatarList));
+ mAvatarListRefreshConnection = mAvatarList->setRefreshCompleteCallback(boost::bind(&LLParticipantList::onAvatarListRefreshed, this, _1, _2));
// Set onAvatarListDoubleClicked as default on_return action.
- mAvatarList->setReturnCallback(boost::bind(&LLParticipantList::onAvatarListDoubleClicked, this, mAvatarList));
+ mAvatarListReturnConnection = mAvatarList->setReturnCallback(boost::bind(&LLParticipantList::onAvatarListDoubleClicked, this, mAvatarList));
if (use_context_menu)
{
@@ -99,6 +99,10 @@ LLParticipantList::LLParticipantList(LLSpeakerMgr* data_source, LLAvatarList* av
LLParticipantList::~LLParticipantList()
{
+ mAvatarListDoubleClickConnection.disconnect();
+ mAvatarListRefreshConnection.disconnect();
+ mAvatarListReturnConnection.disconnect();
+
delete mParticipantListMenu;
mParticipantListMenu = NULL;
}
diff --git a/indra/newview/llparticipantlist.h b/indra/newview/llparticipantlist.h
index 460cf4b9ef..86b38f5f1e 100644
--- a/indra/newview/llparticipantlist.h
+++ b/indra/newview/llparticipantlist.h
@@ -151,4 +151,9 @@ class LLParticipantList
LLParticipantListMenu* mParticipantListMenu;
EParticipantSortOrder mSortOrder;
+
+ // boost::connections
+ boost::signals2::connection mAvatarListDoubleClickConnection;
+ boost::signals2::connection mAvatarListRefreshConnection;
+ boost::signals2::connection mAvatarListReturnConnection;
};