diff options
author | kuchhal@chromium.org <kuchhal@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-23 19:56:42 +0000 |
---|---|---|
committer | kuchhal@chromium.org <kuchhal@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-23 19:56:42 +0000 |
commit | 9face0d972cfb884ac5086d423ced9b44732e1d2 (patch) | |
tree | cab9fbe198080642272bbb8fa4b64c5d46149079 /base/message_loop.cc | |
parent | 3bf6ade0846bb7a03e586a96feda2d9bbd466139 (diff) | |
download | chromium_src-9face0d972cfb884ac5086d423ced9b44732e1d2.zip chromium_src-9face0d972cfb884ac5086d423ced9b44732e1d2.tar.gz chromium_src-9face0d972cfb884ac5086d423ced9b44732e1d2.tar.bz2 |
Cleanup pending tasks under Valgrind as well.
BUG=16095
Review URL: http://codereview.chromium.org/160020
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21429 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/message_loop.cc')
-rw-r--r-- | base/message_loop.cc | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/base/message_loop.cc b/base/message_loop.cc index fbdc94f..da463b1 100644 --- a/base/message_loop.cc +++ b/base/message_loop.cc @@ -372,10 +372,8 @@ bool MessageLoop::DeletePendingTasks() { // TODO(darin): Delete all tasks once it is safe to do so. // Until it is totally safe, just do it when running Purify or // Valgrind. -#if defined(OS_WIN) -#ifdef PURIFY +#if defined(PURIFY) delete pending_task.task; -#endif // PURIFY #elif defined(OS_POSIX) if (RUNNING_ON_VALGRIND) delete pending_task.task; @@ -385,13 +383,19 @@ bool MessageLoop::DeletePendingTasks() { did_work |= !deferred_non_nestable_work_queue_.empty(); while (!deferred_non_nestable_work_queue_.empty()) { // TODO(darin): Delete all tasks once it is safe to do so. - // Until it is totaly safe, just delete them to keep purify happy. -#ifdef PURIFY + // Until it is totaly safe, only delete them under Purify and Valgrind. +#if defined(PURIFY) Task* task = deferred_non_nestable_work_queue_.front().task; +#elif defined(OS_POSIX) + if (RUNNING_ON_VALGRIND) + Task* task = deferred_non_nestable_work_queue_.front().task; #endif deferred_non_nestable_work_queue_.pop(); -#ifdef PURIFY +#if defined(PURIFY) delete task; +#elif defined(OS_POSIX) + if (RUNNING_ON_VALGRIND) + delete task; #endif } did_work |= !delayed_work_queue_.empty(); |