Index: remoting/host/desktop_session_agent.cc |
diff --git a/remoting/host/desktop_session_agent.cc b/remoting/host/desktop_session_agent.cc |
index e490af1abdc082567a03b970b4ca688e83c79b51..5c028d0f13ef1ed6953360e2e454839bd38d630f 100644 |
--- a/remoting/host/desktop_session_agent.cc |
+++ b/remoting/host/desktop_session_agent.cc |
@@ -17,6 +17,7 @@ |
namespace remoting { |
DesktopSessionAgent::~DesktopSessionAgent() { |
+ DCHECK(!network_channel_); |
DCHECK(!video_capturer_); |
} |
@@ -141,6 +142,9 @@ bool DesktopSessionAgent::Start(const base::Closure& disconnected_task, |
void DesktopSessionAgent::Stop() { |
DCHECK(caller_task_runner()->BelongsToCurrentThread()); |
+ // Make sure the channel is closed. |
+ network_channel_.reset(); |
+ |
// Stop the video capturer. |
video_capture_task_runner()->PostTask( |
FROM_HERE, base::Bind(&DesktopSessionAgent::StopVideoCapturer, this)); |