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

Unified Diff: chrome/browser/chromeos/drive/search_metadata.cc

Issue 22243002: GTTF: Enable glibcxx debug mode for Debug builds by default. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years 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 | « build/common.gypi ('k') | chrome/browser/ui/browser_iterator.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/drive/search_metadata.cc
diff --git a/chrome/browser/chromeos/drive/search_metadata.cc b/chrome/browser/chromeos/drive/search_metadata.cc
index 2e4a1d690a691c8eae6c1951adbddcd3611a1302..8886356c04eecfa8020742c3dfd06ebf8d39dc00 100644
--- a/chrome/browser/chromeos/drive/search_metadata.cc
+++ b/chrome/browser/chromeos/drive/search_metadata.cc
@@ -78,8 +78,12 @@ class ScopedPriorityQueue {
void push(T* x) { queue_.push(x); }
void pop() {
- delete queue_.top();
+ // Keep top alive for the pop() call so that debug checks can access
+ // underlying data (e.g. validating heap property of the priority queue
+ // will call the comparator).
+ T* saved_top = queue_.top();
queue_.pop();
+ delete saved_top;
}
private:
« no previous file with comments | « build/common.gypi ('k') | chrome/browser/ui/browser_iterator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698