Commit d04beefc authored by sergeyu's avatar sergeyu Committed by Commit bot

Fix failing DCHECKs in JingleSession added in r294653

r294653 added two DCHECKs in JingleSession in CancelChannelCreation()
and destructor. These checks were failing in the client sometimes. This
CL fixes the code that was causing them to fail:
 1. The ChannelMultiplexer needs to be destroyed explicitly in the
    destructor.
 2. ChannelDispatcherBase was calling CancelChannelCreation() even
    after the channel is created.

Review URL: https://codereview.chromium.org/571273003

Cr-Commit-Position: refs/heads/master@{#295138}
parent bef0b904
...@@ -55,6 +55,7 @@ void ChannelDispatcherBase::OnChannelReady( ...@@ -55,6 +55,7 @@ void ChannelDispatcherBase::OnChannelReady(
return; return;
} }
channel_factory_ = NULL;
channel_ = socket.Pass(); channel_ = socket.Pass();
OnInitialized(); OnInitialized();
......
...@@ -84,7 +84,10 @@ JingleSession::~JingleSession() { ...@@ -84,7 +84,10 @@ JingleSession::~JingleSession() {
pending_requests_.end()); pending_requests_.end());
STLDeleteContainerPointers(transport_info_requests_.begin(), STLDeleteContainerPointers(transport_info_requests_.begin(),
transport_info_requests_.end()); transport_info_requests_.end());
channel_multiplexer_.reset();
DCHECK(channels_.empty()); DCHECK(channels_.empty());
session_manager_->SessionDestroyed(this); session_manager_->SessionDestroyed(this);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment