summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-29 04:01:43 +0000
committersergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-29 04:01:43 +0000
commita9fc5b295a15a1fc19b72d41e641380c7af3e00d (patch)
treeb194e80f9fa3e6705c4d8bcc9338e3cbd3e4de53
parent09b36f984ea775b05d945aeae13b464c9264d3d2 (diff)
downloadchromium_src-a9fc5b295a15a1fc19b72d41e641380c7af3e00d.zip
chromium_src-a9fc5b295a15a1fc19b72d41e641380c7af3e00d.tar.gz
chromium_src-a9fc5b295a15a1fc19b72d41e641380c7af3e00d.tar.bz2
Don't delete channels in JingleSession::CloseInternal().
Channel creators should be destroyed using CancelChannelCreation(). Previously the code was crashing in CancelChannelCreation() when trying to delete an object that has already been deleted. BUG=105035 Review URL: http://codereview.chromium.org/8726018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@111866 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--remoting/protocol/jingle_session.cc4
-rw-r--r--remoting/protocol/session.h3
2 files changed, 3 insertions, 4 deletions
diff --git a/remoting/protocol/jingle_session.cc b/remoting/protocol/jingle_session.cc
index 21f8426..ef0dfad 100644
--- a/remoting/protocol/jingle_session.cc
+++ b/remoting/protocol/jingle_session.cc
@@ -71,6 +71,7 @@ JingleSession::~JingleSession() {
state_change_callback_.Reset();
Close();
jingle_session_manager_->SessionDestroyed(this);
+ DCHECK(channel_connectors_.empty());
}
void JingleSession::Init(cricket::Session* cricket_session) {
@@ -90,9 +91,6 @@ void JingleSession::CloseInternal(int result, Error error) {
if (state_ != FAILED && state_ != CLOSED && !closing_) {
closing_ = true;
- STLDeleteContainerPairSecondPointers(channel_connectors_.begin(),
- channel_connectors_.end());
-
// Tear down the cricket session, including the cricket transport channels.
if (cricket_session_) {
std::string reason;
diff --git a/remoting/protocol/session.h b/remoting/protocol/session.h
index 603f733..346fb28 100644
--- a/remoting/protocol/session.h
+++ b/remoting/protocol/session.h
@@ -88,7 +88,8 @@ class Session : public base::NonThreadSafe {
// Cancels a pending CreateStreamChannel() or CreateDatagramChannel()
// operation for the named channel. If the channel creation already
- // completed then cancelling it has no effect.
+ // completed then cancelling it has no effect. When shutting down
+ // this method must be called for each channel pending creation.
virtual void CancelChannelCreation(const std::string& name) = 0;
// JID of the other side.