From ef73740190a357c77f4d49ebb0270007a1cc586b Mon Sep 17 00:00:00 2001 From: "sky@chromium.org" Date: Wed, 9 Sep 2009 16:32:21 +0000 Subject: 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 --- views/controls/tabbed_pane/native_tabbed_pane_gtk.cc | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'views/controls/tabbed_pane') 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; -- cgit v1.1