summaryrefslogtreecommitdiffstats
path: root/base
diff options
context:
space:
mode:
authorjar@chromium.org <jar@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-11 19:46:41 +0000
committerjar@chromium.org <jar@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-11 19:46:41 +0000
commit204728384a0e18c5b1a98ebb12d83b467e48b138 (patch)
tree9b68f941117dc326ce34d9bb29c5d3ebfb1dc4f7 /base
parentff81cfa009ea895ac58c1366a956c0aa022c23d1 (diff)
downloadchromium_src-204728384a0e18c5b1a98ebb12d83b467e48b138.zip
chromium_src-204728384a0e18c5b1a98ebb12d83b467e48b138.tar.gz
chromium_src-204728384a0e18c5b1a98ebb12d83b467e48b138.tar.bz2
Avoid leaks at shutdown when running purify
We'll risk a (rare) crash under purify, but avoid having a leak detected. Note that this "leak" at shutdown is NBD, but this code at least shows that the would be leak is "understood" and acceptable. bug=6532 r=erikkay Review URL: http://codereview.chromium.org/42083 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11473 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base')
-rw-r--r--base/message_loop.cc14
1 files changed, 10 insertions, 4 deletions
diff --git a/base/message_loop.cc b/base/message_loop.cc
index a57946b..3f216dc 100644
--- a/base/message_loop.cc
+++ b/base/message_loop.cc
@@ -365,15 +365,21 @@ bool MessageLoop::DeletePendingTasks() {
AddToDelayedWorkQueue(pending_task);
} else {
// TODO(darin): Delete all tasks once it is safe to do so.
- //delete task;
+ // Until it is totally safe, just do it when running purify.
+#ifdef PURIFY
+ delete task;
+#endif // PURIFY
}
}
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.
- //Task* task = deferred_non_nestable_work_queue_.front().task;
+ Task* task = deferred_non_nestable_work_queue_.front().task;
deferred_non_nestable_work_queue_.pop();
- //delete task;
+ // 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
+ delete task;
+#endif
}
did_work |= !delayed_work_queue_.empty();
while (!delayed_work_queue_.empty()) {