Index: remoting/protocol/jingle_session.cc |
diff --git a/remoting/protocol/jingle_session.cc b/remoting/protocol/jingle_session.cc |
index 90a1a7703e7762d8c260dcd37eb751621ceeb45b..2726365f89cbd8e7e6b8fe0ae4c13ea9671eba5d 100644 |
--- a/remoting/protocol/jingle_session.cc |
+++ b/remoting/protocol/jingle_session.cc |
@@ -159,7 +159,9 @@ JingleSession::JingleSession( |
} |
JingleSession::~JingleSession() { |
- DCHECK(closed_); |
+ // Reset the callback so that it's not called from Close(). |
+ state_change_callback_.reset(); |
+ Close(); |
jingle_session_manager_->SessionDestroyed(this); |
} |
@@ -212,8 +214,11 @@ void JingleSession::CloseInternal(int result, bool failed) { |
if (video_rtcp_channel_.get()) |
video_rtcp_channel_->Close(result); |
- if (cricket_session_) |
+ if (cricket_session_) { |
cricket_session_->Terminate(); |
+ cricket_session_->SignalState.disconnect(this); |
+ cricket_session_ = NULL; |
+ } |
if (failed) |
SetState(FAILED); |