summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-04 21:57:48 +0000
committerjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-04 21:57:48 +0000
commit579d71deb2e0c8139ca1d49c0fa436444e94eead (patch)
treeca51201ee9362ef7108a6ec8faef1c7c14d389f4 /chrome
parent3290c948762c47292fb388de8318859ee22b6688 (diff)
downloadchromium_src-579d71deb2e0c8139ca1d49c0fa436444e94eead.zip
chromium_src-579d71deb2e0c8139ca1d49c0fa436444e94eead.tar.gz
chromium_src-579d71deb2e0c8139ca1d49c0fa436444e94eead.tar.bz2
Stop each ChromeThread before nulling out the entry in chrome_threads_. This allows DCHECKs that the code is running on the correct thread to succeed.
BUG=26714 Review URL: http://codereview.chromium.org/363010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31010 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/chrome_thread.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/chrome/browser/chrome_thread.cc b/chrome/browser/chrome_thread.cc
index f05fb68..65e33e7 100644
--- a/chrome/browser/chrome_thread.cc
+++ b/chrome/browser/chrome_thread.cc
@@ -41,6 +41,11 @@ void ChromeThread::Initialize() {
}
ChromeThread::~ChromeThread() {
+ // Stop the thread here, instead of the parent's class destructor. This is so
+ // that if there are pending tasks that run, code that checks that it's on the
+ // correct ChromeThread succeeds.
+ Stop();
+
AutoLock lock(lock_);
chrome_threads_[identifier_] = NULL;
#ifndef NDEBUG