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

Unified Diff: views/controls/native/native_view_host_gtk.cc

Issue 159130: Fix two crashers with TOOLKIT_VIEWS build:... (Closed) Base URL: svn://svn.chromium.org/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 | « chrome/browser/views/tab_contents/tab_contents_view_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/native/native_view_host_gtk.cc
===================================================================
--- views/controls/native/native_view_host_gtk.cc (revision 21157)
+++ views/controls/native/native_view_host_gtk.cc (working copy)
@@ -87,8 +87,13 @@
WidgetGtk* parent_widget = GetHostWidget();
gtk_widget_hide(host_->native_view());
if (parent_widget) {
- gtk_container_remove(GTK_CONTAINER(parent_widget->window_contents()),
- host_->native_view());
+ // We can be called after the contents widget has been destroyed, e.g. any
+ // NativeViewHost not removed from the view hierarchy before the window is
+ // closed.
+ if (GTK_IS_CONTAINER(parent_widget->window_contents())) {
+ gtk_container_remove(GTK_CONTAINER(parent_widget->window_contents()),
+ host_->native_view());
+ }
}
}
« no previous file with comments | « chrome/browser/views/tab_contents/tab_contents_view_gtk.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698