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

Unified Diff: webrtc/api/peerconnection.cc

Issue 2583613003: Fix segfault when PeerConnection is destroyed during stats collection. (Closed)
Patch Set: 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') | webrtc/api/rtcstats_integrationtest.cc » ('J')
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..f78825e69afa252cc81423154f9f8454fb6ea437 100644
--- a/webrtc/api/peerconnection.cc
+++ b/webrtc/api/peerconnection.cc
@@ -608,6 +608,8 @@ PeerConnection::~PeerConnection() {
}
// Destroy stats_ because it depends on session_.
stats_.reset(nullptr);
+ stats_collector_->WaitForPendingRequest();
hta-webrtc 2016/12/16 14:05:31 Doing waiting in a destructor makes me itchy. The
hbos 2016/12/16 14:34:52 I'm afraid not, PeerConnectionInterface is referen
hta-webrtc 2016/12/17 19:51:30 OK, the only thing that calls the destructor is th
+ 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') | webrtc/api/rtcstats_integrationtest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698