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

Unified Diff: base/scoped_vector.h

Issue 3183019: Mac: Fix leak in tabpose. (Closed)
Patch Set: Created 10 years, 4 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 | chrome/browser/cocoa/tabpose_window.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/scoped_vector.h
diff --git a/base/scoped_vector.h b/base/scoped_vector.h
index 8e4dd7c004232ff9c4aa1e477b50a7051a2f2e44..b797078572b8acbfe9be1864af17927c890dddea 100644
--- a/base/scoped_vector.h
+++ b/base/scoped_vector.h
@@ -27,7 +27,7 @@ class ScopedVector {
std::vector<T*>* operator->() { return &v; }
const std::vector<T*>* operator->() const { return &v; }
- T* operator[](size_t i) { return v[i]; }
+ T*& operator[](size_t i) { return v[i]; }
viettrungluu 2010/08/19 18:57:44 Wow, that was broken before.
const T* operator[](size_t i) const { return v[i]; }
bool empty() const { return v.empty(); }
@@ -54,6 +54,7 @@ class ScopedVector {
}
void reset() { STLDeleteElements(&v); }
+ void resize(size_t new_size) { v.resize(new_size); }
private:
std::vector<T*> v;
« no previous file with comments | « no previous file | chrome/browser/cocoa/tabpose_window.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698