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

Unified Diff: webrtc/pc/peerconnection.cc

Issue 3012783002: Reland of Make RtcEventLogImpl to use a TaskQueue instead of a helper-thread ( https://codereview.w… (Closed)
Patch Set: Rebased and PeerConnection fixed. Created 3 years, 3 months 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
Index: webrtc/pc/peerconnection.cc
diff --git a/webrtc/pc/peerconnection.cc b/webrtc/pc/peerconnection.cc
index e22a09ece06998d12cd2db9dba82c4f0231b368c..b258c1fc999c887c172d93a958d5f7c072ab3f19 100644
--- a/webrtc/pc/peerconnection.cc
+++ b/webrtc/pc/peerconnection.cc
@@ -425,9 +425,11 @@ PeerConnection::~PeerConnection() {
// port_allocator_ lives on the network thread and should be destroyed there.
network_thread()->Invoke<void>(RTC_FROM_HERE,
[this] { port_allocator_.reset(); });
- // call_ must be destroyed on the worker thread.
- factory_->worker_thread()->Invoke<void>(RTC_FROM_HERE,
- [this] { call_.reset(); });
+ // call_ and event_log_ must be destroyed on the worker thread.
+ factory_->worker_thread()->Invoke<void>(RTC_FROM_HERE, [this] {
+ call_.reset();
+ event_log_.reset();
+ });
}
bool PeerConnection::Initialize(
@@ -1337,11 +1339,11 @@ void PeerConnection::Close() {
rtc::Bind(&cricket::PortAllocator::DiscardCandidatePool,
port_allocator_.get()));
- factory_->worker_thread()->Invoke<void>(RTC_FROM_HERE,
- [this] { call_.reset(); });
-
- // The event log must outlive call (and any other object that uses it).
- event_log_.reset();
+ factory_->worker_thread()->Invoke<void>(RTC_FROM_HERE, [this] {
+ call_.reset();
+ // The event log must outlive call (and any other object that uses it).
+ event_log_.reset();
+ });
}
void PeerConnection::OnSessionStateChange(WebRtcSession* /*session*/,

Powered by Google App Engine
This is Rietveld 408576698