Index: remoting/protocol/webrtc_transport.cc |
diff --git a/remoting/protocol/webrtc_transport.cc b/remoting/protocol/webrtc_transport.cc |
index ac3b6b32398af1d83681118b97f228692b22d623..76b557c94150cd6421634059432348c025aaceee 100644 |
--- a/remoting/protocol/webrtc_transport.cc |
+++ b/remoting/protocol/webrtc_transport.cc |
@@ -135,7 +135,6 @@ class SetSessionDescriptionObserver |
DISALLOW_COPY_AND_ASSIGN(SetSessionDescriptionObserver); |
}; |
- |
} // namespace |
WebrtcTransport::WebrtcTransport( |
@@ -150,7 +149,13 @@ WebrtcTransport::WebrtcTransport( |
transport_context_->set_relay_mode(TransportContext::RelayMode::TURN); |
} |
-WebrtcTransport::~WebrtcTransport() {} |
+WebrtcTransport::~WebrtcTransport() { |
+ // Destroy |fake_audio_device_module_| asynchronously. PeerConnection may be |
+ // on the stack and so it will be destroyed later. We need to ensures that |
Jamie
2016/07/23 00:03:48
s/ensures/ensure/
Sergey Ulanov
2016/07/23 06:30:04
reworded this comment
|
+ // |fake_audio_device_module_| is destroyed only after that. |
+ base::ThreadTaskRunnerHandle::Get()->DeleteSoon( |
+ FROM_HERE, fake_audio_device_module_.release()); |
+} |
std::unique_ptr<MessagePipe> WebrtcTransport::CreateOutgoingChannel( |
const std::string& name) { |