Index: webrtc/api/peerconnection.cc |
diff --git a/webrtc/api/peerconnection.cc b/webrtc/api/peerconnection.cc |
index ebce40ca5eb0cf37d03243663826ea911eda06c3..58174f08c11bbd10d36e58c3420a3d06ff8b909e 100644 |
--- a/webrtc/api/peerconnection.cc |
+++ b/webrtc/api/peerconnection.cc |
@@ -608,6 +608,10 @@ PeerConnection::~PeerConnection() { |
} |
// Destroy stats_ because it depends on session_. |
stats_.reset(nullptr); |
+ if (stats_collector_) { |
+ stats_collector_->WaitForPendingRequest(); |
Taylor Brandstetter
2016/12/16 18:53:27
nit: I'd just put this in the RTCStatsCollector de
hbos
2016/12/19 09:52:48
It's not that you have to wait before destroying t
|
+ stats_collector_ = nullptr; |
+ } |
// Now destroy session_ before destroying other members, |
// because its destruction fires signals (such as VoiceChannelDestroyed) |
// which will trigger some final actions in PeerConnection... |