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

Unified Diff: base/message_loop.cc

Issue 160020: Cleanup pending tasks under Valgrind as well. (Closed)
Patch Set: Created 11 years, 5 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 | no next file » | 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 fbdc94f13d879a0b938ff4bdcb4a1282499e9d95..da463b1cb1ec1be788184bd5827b75bca990607a 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)
Erik does not do reviews 2009/07/23 17:48:26 can these conditionals just be changed to #if defi
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();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698