Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(440)

Unified Diff: webrtc/api/peerconnection.cc

Issue 2583613003: Fix segfault when PeerConnection is destroyed during stats collection. (Closed)
Patch Set: DCHECK in destructor added Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | webrtc/api/rtcstats_integrationtest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
+ 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...
« no previous file with comments | « no previous file | webrtc/api/rtcstats_integrationtest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698