Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(947)

Unified Diff: base/message_loop.cc

Issue 115328: During shutdown delete any pending tasks if running under Valgrind. (Closed)
Patch Set: "code reviews fixes" Created 11 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | base/third_party/valgrind/README » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/message_loop.cc
diff --git a/base/message_loop.cc b/base/message_loop.cc
index 764a96332560529138ca1bdcaa37a9f97f95cb39..4f9dc0be39683cd0a2991246052acd3f2f2de33c 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();
« no previous file with comments | « no previous file | base/third_party/valgrind/README » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698