| 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:
|
|
|