diff options
author | akalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-02 19:27:43 +0000 |
---|---|---|
committer | akalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-02 19:27:43 +0000 |
commit | f35f129b49f4d260211bb6693da281bae11e0249 (patch) | |
tree | 8655c66d33c42cab0eb87dfbe72555c89bd4fa13 /base/message_loop.cc | |
parent | fc09858d0548cd733c5aa7e34d07c8a947154f74 (diff) | |
download | chromium_src-f35f129b49f4d260211bb6693da281bae11e0249.zip chromium_src-f35f129b49f4d260211bb6693da281bae11e0249.tar.gz chromium_src-f35f129b49f4d260211bb6693da281bae11e0249.tar.bz2 |
Delete tasks unconditionally in MessageLoop::DeletePendingTasks().
BUG=6532
TEST=existing unit tests
Review URL: http://codereview.chromium.org/3076015
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@54584 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/message_loop.cc')
-rw-r--r-- | base/message_loop.cc | 23 |
1 files changed, 2 insertions, 21 deletions
diff --git a/base/message_loop.cc b/base/message_loop.cc index 1d86f79..d67e64a 100644 --- a/base/message_loop.cc +++ b/base/message_loop.cc @@ -466,37 +466,18 @@ bool MessageLoop::DeletePendingTasks() { // tasks. AddToDelayedWorkQueue(pending_task); } else { - // 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(PURIFY) delete pending_task.task; -#elif defined(OS_POSIX) - if (RUNNING_ON_VALGRIND) - delete pending_task.task; -#endif // defined(OS_POSIX) } } 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, only delete them under Purify and Valgrind. - Task* task = NULL; -#if defined(PURIFY) - task = deferred_non_nestable_work_queue_.front().task; -#elif defined(OS_POSIX) - if (RUNNING_ON_VALGRIND) - task = deferred_non_nestable_work_queue_.front().task; -#endif + delete deferred_non_nestable_work_queue_.front().task; deferred_non_nestable_work_queue_.pop(); - if (task) - delete task; } did_work |= !delayed_work_queue_.empty(); while (!delayed_work_queue_.empty()) { - Task* task = delayed_work_queue_.top().task; + delete delayed_work_queue_.top().task; delayed_work_queue_.pop(); - delete task; } return did_work; } |