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

Unified Diff: chrome/browser/views/tabs/tab_strip.cc

Issue 155195: Fix memory leaks introduced and exposed by r20028. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 5 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/views/tabs/tab_strip.cc
===================================================================
--- chrome/browser/views/tabs/tab_strip.cc (revision 20100)
+++ chrome/browser/views/tabs/tab_strip.cc (working copy)
@@ -1102,8 +1102,11 @@
// If we don't have a theme provider yet, it means we do not have a
// root view, and are therefore in a test.
- if (tp == NULL)
+ bool in_test = false;
+ if (tp == NULL) {
tp = new views::DefaultThemeProvider();
+ in_test = true;
+ }
SkBitmap* bitmap = tp->GetBitmapNamed(IDR_NEWTAB_BUTTON);
SkColor color = tp->GetColor(BrowserThemeProvider::COLOR_BUTTON_BACKGROUND);
@@ -1117,6 +1120,8 @@
tp->GetBitmapNamed(IDR_NEWTAB_BUTTON_H));
newtab_button_->SetBackground(color, background,
tp->GetBitmapNamed(IDR_NEWTAB_BUTTON_MASK));
+ if (in_test)
+ delete tp;
}
Tab* TabStrip::GetTabAt(int index) const {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698