summaryrefslogtreecommitdiffstats
path: root/base/message_loop.cc
diff options
context:
space:
mode:
authorsanjeevr@chromium.org <sanjeevr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-30 00:25:29 +0000
committersanjeevr@chromium.org <sanjeevr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-30 00:25:29 +0000
commit582384779d93227fc44bb347947a094505080858 (patch)
treef8bd7b1b120f03cb6115491d034de95409261bd3 /base/message_loop.cc
parentdf0f70c0ad5d48b173827a6e8bec72b4f856954a (diff)
downloadchromium_src-582384779d93227fc44bb347947a094505080858.zip
chromium_src-582384779d93227fc44bb347947a094505080858.tar.gz
chromium_src-582384779d93227fc44bb347947a094505080858.tar.bz2
Moved the calls to the MessageLoop destruction observers to after the pending tasks are deleted.
BUG=None TEST=Unit-test provided, tests should pass and all hell should not break loose. Review URL: http://codereview.chromium.org/5318003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@67623 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/message_loop.cc')
-rw-r--r--base/message_loop.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/base/message_loop.cc b/base/message_loop.cc
index 57eda53..823670f 100644
--- a/base/message_loop.cc
+++ b/base/message_loop.cc
@@ -162,10 +162,6 @@ MessageLoop::MessageLoop(Type type)
MessageLoop::~MessageLoop() {
DCHECK_EQ(this, current());
- // Let interested parties have one last shot at accessing this.
- FOR_EACH_OBSERVER(DestructionObserver, destruction_observers_,
- WillDestroyCurrentMessageLoop());
-
DCHECK(!state_);
// Clean up any unprocessed tasks, but take care: deleting a task could
@@ -185,6 +181,10 @@ MessageLoop::~MessageLoop() {
}
DCHECK(!did_work);
+ // Let interested parties have one last shot at accessing this.
+ FOR_EACH_OBSERVER(DestructionObserver, destruction_observers_,
+ WillDestroyCurrentMessageLoop());
+
// OK, now make it so that no one can find us.
lazy_tls_ptr.Pointer()->Set(NULL);
}