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

Unified Diff: views/controls/tabbed_pane/native_tabbed_pane_gtk.cc

Issue 198010: * Fix seg fault in deleting view from RemoveTabAtIndex... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: * Fix seg fault in deleting view from RemoveTabAtIndex... Created 11 years, 3 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 | « views/controls/combobox/native_combobox_gtk.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/controls/tabbed_pane/native_tabbed_pane_gtk.cc
===================================================================
--- views/controls/tabbed_pane/native_tabbed_pane_gtk.cc (revision 25669)
+++ views/controls/tabbed_pane/native_tabbed_pane_gtk.cc (working copy)
@@ -60,8 +60,17 @@
// 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.
sky 2009/09/09 03:23:15 nit: delete -> deletes
gtk_notebook_remove_page(GTK_NOTEBOOK(native_view()), index);
return removed_tab;
« no previous file with comments | « views/controls/combobox/native_combobox_gtk.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698