summaryrefslogtreecommitdiffstats
path: root/base/message_loop.cc
diff options
context:
space:
mode:
authorkuchhal@chromium.org <kuchhal@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-14 16:44:26 +0000
committerkuchhal@chromium.org <kuchhal@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-14 16:44:26 +0000
commitd680c5c189ec40b97cee8c201de88dfe5256153f (patch)
treefc0e4c46460df9e7b2c6f06432762451a1adb84f /base/message_loop.cc
parent7e817aaa51bf4b9afb9672935ca02585205ac804 (diff)
downloadchromium_src-d680c5c189ec40b97cee8c201de88dfe5256153f.zip
chromium_src-d680c5c189ec40b97cee8c201de88dfe5256153f.tar.gz
chromium_src-d680c5c189ec40b97cee8c201de88dfe5256153f.tar.bz2
During shutdown delete any pending tasks if running under Valgrind.
BUG=10755 Review URL: http://codereview.chromium.org/115328 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16060 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/message_loop.cc')
-rw-r--r--base/message_loop.cc9
1 files changed, 8 insertions, 1 deletions
diff --git a/base/message_loop.cc b/base/message_loop.cc
index 764a963..4f9dc0b 100644
--- a/base/message_loop.cc
+++ b/base/message_loop.cc
@@ -18,6 +18,7 @@
#endif
#if defined(OS_POSIX)
#include "base/message_pump_libevent.h"
+#include "base/third_party/valgrind/valgrind.h"
#endif
#if defined(OS_LINUX)
#include "base/message_pump_glib.h"
@@ -365,10 +366,16 @@ bool MessageLoop::DeletePendingTasks() {
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.
+ // Until it is totally safe, just do it when running Purify or
+ // Valgrind.
+#if defined(OS_WIN)
#ifdef PURIFY
delete pending_task.task;
#endif // PURIFY
+#elif defined(OS_POSIX)
+ if (RUNNING_ON_VALGRIND)
+ delete pending_task.task;
+#endif // defined(OS_POSIX)
}
}
did_work |= !deferred_non_nestable_work_queue_.empty();