diff options
author | jhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-20 22:12:40 +0000 |
---|---|---|
committer | jhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-20 22:12:40 +0000 |
commit | 85883a10c1b7641c4e94575443ce66d825dab583 (patch) | |
tree | bfde7a4c5665375d7b0d0d43b7638ada987642e9 /chrome/browser/gtk/tabs | |
parent | e5e19c3476afa746b3baec8be9ea12532452afbb (diff) | |
download | chromium_src-85883a10c1b7641c4e94575443ce66d825dab583.zip chromium_src-85883a10c1b7641c4e94575443ce66d825dab583.tar.gz chromium_src-85883a10c1b7641c4e94575443ce66d825dab583.tar.bz2 |
Make sure to free any remaining tabs on tabstrip destruction. There are two cases where the remove tab animation is not used when closing tabs, and we were leaking these tabs in those cases.
Review URL: http://codereview.chromium.org/87004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@14066 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/gtk/tabs')
-rw-r--r-- | chrome/browser/gtk/tabs/tab_strip_gtk.cc | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/chrome/browser/gtk/tabs/tab_strip_gtk.cc b/chrome/browser/gtk/tabs/tab_strip_gtk.cc index 8423378..65e36d5 100644 --- a/chrome/browser/gtk/tabs/tab_strip_gtk.cc +++ b/chrome/browser/gtk/tabs/tab_strip_gtk.cc @@ -386,6 +386,16 @@ TabStripGtk::TabStripGtk(TabStripModel* model) TabStripGtk::~TabStripGtk() { model_->RemoveObserver(this); tabstrip_.Destroy(); + + // Free any remaining tabs. This is needed to free the very last tab, + // because it is not animated on close. This also happens when all of the + // tabs are closed at once. + std::vector<TabData>::iterator iterator = tab_data_.begin(); + for (; iterator < tab_data_.end(); iterator++) { + delete iterator->tab; + } + + tab_data_.clear(); } void TabStripGtk::Init() { |