summaryrefslogtreecommitdiffstats
path: root/base/message_loop.cc
diff options
context:
space:
mode:
authorkuchhal@chromium.org <kuchhal@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-23 22:28:49 +0000
committerkuchhal@chromium.org <kuchhal@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-23 22:28:49 +0000
commit686dd8db46810742a3eeec888c293aa528d4a938 (patch)
tree37658683d5f2e1fd721819d39e87aabe793d76a6 /base/message_loop.cc
parenta006e1878613f46b7b0a8ca80ce5017a28e8cf4f (diff)
downloadchromium_src-686dd8db46810742a3eeec888c293aa528d4a938.zip
chromium_src-686dd8db46810742a3eeec888c293aa528d4a938.tar.gz
chromium_src-686dd8db46810742a3eeec888c293aa528d4a938.tar.bz2
Reapply r21429 - Cleanup pending tasks under Valgrind as well.
BUG=16095 Review URL: http://codereview.chromium.org/160035 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21459 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/message_loop.cc')
-rw-r--r--base/message_loop.cc19
1 files changed, 10 insertions, 9 deletions
diff --git a/base/message_loop.cc b/base/message_loop.cc
index fbdc94f..4c91b1f 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,14 +383,17 @@ 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
- Task* task = deferred_non_nestable_work_queue_.front().task;
+ // 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
deferred_non_nestable_work_queue_.pop();
-#ifdef PURIFY
- delete task;
-#endif
+ if (task)
+ delete task;
}
did_work |= !delayed_work_queue_.empty();
while (!delayed_work_queue_.empty()) {