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

Unified Diff: base/barrier_closure.cc

Issue 1116833002: Fixed member use after destruction in BarrierClosure. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comments addressed. Created 5 years, 7 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 | « no previous file | base/barrier_closure_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/barrier_closure.cc
diff --git a/base/barrier_closure.cc b/base/barrier_closure.cc
index 1b77429ae3f3041294f89d77ffb00a76075e1355..1dcc50238fb07e00e8d86cf7b8db06c0ff23e5fb 100644
--- a/base/barrier_closure.cc
+++ b/base/barrier_closure.cc
@@ -28,8 +28,9 @@ BarrierInfo::BarrierInfo(int num_callbacks, const base::Closure& done_closure)
void BarrierInfo::Run() {
DCHECK(!base::AtomicRefCountIsZero(&num_callbacks_left_));
if (!base::AtomicRefCountDec(&num_callbacks_left_)) {
- done_closure_.Run();
+ base::Closure done_closure = done_closure_;
done_closure_.Reset();
+ done_closure.Run();
}
}
« no previous file with comments | « no previous file | base/barrier_closure_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698