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

Unified Diff: base/timer/timer.h

Issue 2624133004: Fix use-after-free in base::Timer::StopAndAbandon() (Closed)
Patch Set: Merge branch 'master' into timer_bug Created 3 years, 11 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/timer/timer_unittest.cc » ('j') | base/timer/timer_unittest.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/timer/timer.h
diff --git a/base/timer/timer.h b/base/timer/timer.h
index 50aedbd4cec28e97c408b2acd8b896c70526732c..dae04356e8bdcb0c755e9e6a622dd11caa34c974 100644
--- a/base/timer/timer.h
+++ b/base/timer/timer.h
@@ -163,8 +163,10 @@ class BASE_EXPORT Timer {
// Stop running task (if any) and abandon scheduled task (if any).
void StopAndAbandon() {
dominickn 2017/01/12 03:27:17 Note for base/timer owners: is it worth changing t
gab 2017/01/12 19:42:54 No as I'm rewriting all of base::Timer in upcoming
- Stop();
AbandonScheduledTask();
+
+ Stop();
+ // No more member accesses here: *this could be deleted at this point.
gab 2017/01/12 19:42:54 s/*this/|this|/
}
// When non-NULL, the scheduled_task_ is waiting in the MessageLoop to call
« no previous file with comments | « no previous file | base/timer/timer_unittest.cc » ('j') | base/timer/timer_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698