summaryrefslogtreecommitdiffstats
path: root/views/controls/tabbed_pane
diff options
context:
space:
mode:
authorsky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-09 16:32:21 +0000
committersky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-09 16:32:21 +0000
commitef73740190a357c77f4d49ebb0270007a1cc586b (patch)
tree33476a2ae6a1742687af0928793566d16b0c9d52 /views/controls/tabbed_pane
parent97fee079f76d2f7099f4fce9750fe2dcb62609a0 (diff)
downloadchromium_src-ef73740190a357c77f4d49ebb0270007a1cc586b.zip
chromium_src-ef73740190a357c77f4d49ebb0270007a1cc586b.tar.gz
chromium_src-ef73740190a357c77f4d49ebb0270007a1cc586b.tar.bz2
Lands http://codereview.chromium.org/198010 for Oshima:
* Fix seg fault in deleting view from RemoveTabAtIndex * move initialization of tabbed page to NativeControlCreated TEST=none BUG=none Review URL: http://codereview.chromium.org/196055 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25730 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/controls/tabbed_pane')
-rw-r--r--views/controls/tabbed_pane/native_tabbed_pane_gtk.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/views/controls/tabbed_pane/native_tabbed_pane_gtk.cc b/views/controls/tabbed_pane/native_tabbed_pane_gtk.cc
index 855ce805..3a454fe 100644
--- a/views/controls/tabbed_pane/native_tabbed_pane_gtk.cc
+++ b/views/controls/tabbed_pane/native_tabbed_pane_gtk.cc
@@ -60,8 +60,17 @@ View* NativeTabbedPaneGtk::RemoveTabAtIndex(int index) {
// last tab. nothing to select.
}
}
+
+ GtkWidget* page =
+ gtk_notebook_get_nth_page(GTK_NOTEBOOK(native_view()), index);
+ WidgetGtk* widget = WidgetGtk::GetViewForNative(page);
+
+ // detach the content view from widget so that we can delete widget
+ // without destroying the content view.
View* removed_tab = GetTabViewAt(index);
+ widget->GetRootView()->RemoveChildView(removed_tab);
+ // widget delete itself when native_view is deleted.
gtk_notebook_remove_page(GTK_NOTEBOOK(native_view()), index);
return removed_tab;