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

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, 1 month 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
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 c436f0a723811b1621dcbaaeca9e9050e805e073..be89597d87b6f9a47c0a08180927e01a5e598962 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:

Powered by Google App Engine
This is Rietveld 408576698