Commits

Anonymous committed 78dad65

Fixed major bug EXT-6869 (Viewer crashes when switching between group voice sessions)

The reason: LLCallDialogManager did not disconnect from "voice channel state changed" signal on channel in previous session.
Thus when old channel changes state from STATE_HUNG_UP to STATE_CALL_STARTED there is invalid pointer to session in connected LLCallDialogManager::onVoiceChannelStateChanged callback before current voice channel is changed and pointer to session becames valid.

Fix: add storing of connection to signal in voice channel from previous session and disconnect it before connecting to channel in current session.

Reviewed by Vadim Savchuk at https://codereview.productengine.com/secondlife/r/244/

Comments (0)

Files changed (1)

indra/newview/llimview.cpp

 	}
 
 	sSession = session;
-	sSession->mVoiceChannel->setStateChangedCallback(boost::bind(LLCallDialogManager::onVoiceChannelStateChanged, _1, _2, _3, _4));
+
+	static boost::signals2::connection prev_channel_state_changed_connection;
+	// disconnect previously connected callback to avoid have invalid sSession in onVoiceChannelStateChanged()
+	prev_channel_state_changed_connection.disconnect();
+	prev_channel_state_changed_connection =
+		sSession->mVoiceChannel->setStateChangedCallback(boost::bind(LLCallDialogManager::onVoiceChannelStateChanged, _1, _2, _3, _4));
+
 	if(sCurrentSessionlName != session->mName)
 	{
 		sPreviousSessionlName = sCurrentSessionlName;