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

Unified Diff: content/browser/browser_thread_impl.cc

Issue 8343062: Quick fix for memory race inherent to all subclasses of base::Thread. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 2 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/browser_thread_impl.cc
diff --git a/content/browser/browser_thread_impl.cc b/content/browser/browser_thread_impl.cc
index 39fa636da7235c03cc66474a1d2bacae7605aff3..fcccb0c1dfa68fedbfb89ad81dc14658995806d1 100644
--- a/content/browser/browser_thread_impl.cc
+++ b/content/browser/browser_thread_impl.cc
@@ -43,6 +43,12 @@ BrowserThreadImpl::BrowserThreadImpl(BrowserThread::ID identifier,
}
BrowserThreadImpl::~BrowserThreadImpl() {
+ // Subclasses of base::Thread() (or at least the most-derived
+ // subclass) must call Stop() in their destructor, otherwise the
+ // vtable for the object can change while the thread's message loop
+ // is still running, and it uses the object's vtable (it calls the
+ // virtual method Run).
+ Stop();
}
// static
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698