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

Unified Diff: webrtc/base/asyncinvoker.cc

Issue 2859443002: Revert of Relanding: Fixing crash that can occur if signal is modified while firing. (Closed)
Patch Set: Created 3 years, 8 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
« no previous file with comments | « webrtc/base/asyncinvoker.h ('k') | webrtc/base/sigslot.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/base/asyncinvoker.cc
diff --git a/webrtc/base/asyncinvoker.cc b/webrtc/base/asyncinvoker.cc
index cabd8b506d0575ee3e3b41a479f6f7b9fcf63ee8..a143e25f19341bd2d3368c991aca8ab9c1e4d418 100644
--- a/webrtc/base/asyncinvoker.cc
+++ b/webrtc/base/asyncinvoker.cc
@@ -20,6 +20,7 @@
AsyncInvoker::~AsyncInvoker() {
destroying_ = true;
+ SignalInvokerDestroyed();
// Messages for this need to be cleared *before* our destructor is complete.
MessageQueueManager::Clear(this);
// And we need to wait for any invocations that are still in progress on
@@ -125,9 +126,8 @@
calling_thread_(calling_thread) {
calling_thread->SignalQueueDestroyed.connect(
this, &NotifyingAsyncClosureBase::CancelCallback);
- // Note: We don't need to listen for the invoker being destroyed, because it
- // will wait for this closure to be destroyed (and pending_invocations_ to go
- // to 0) before its destructor completes.
+ invoker->SignalInvokerDestroyed.connect(
+ this, &NotifyingAsyncClosureBase::CancelCallback);
}
NotifyingAsyncClosureBase::~NotifyingAsyncClosureBase() {
« no previous file with comments | « webrtc/base/asyncinvoker.h ('k') | webrtc/base/sigslot.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698