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

Unified Diff: views/controls/native_control_gtk.cc

Issue 510004: Fix crash/leak issue in native_view_host_gtk.cc. (Closed)
Patch Set: " Created 11 years 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/native/native_view_host_wrapper.h ('k') | views/widget/widget_gtk.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/controls/native_control_gtk.cc
diff --git a/views/controls/native_control_gtk.cc b/views/controls/native_control_gtk.cc
index 49453efe71380f7bf0ce9f20732a05462682e50f..66e6994358b806e7c6561e4194f32fa58ef32d2a 100644
--- a/views/controls/native_control_gtk.cc
+++ b/views/controls/native_control_gtk.cc
@@ -49,9 +49,9 @@ void NativeControlGtk::VisibilityChanged(View* starting_from, bool is_visible) {
if (native_view()) {
// We destroy the child widget when we become invisible because of the
// performance cost of maintaining widgets that aren't currently needed.
- GtkWidget* widget = native_view();
Detach();
- gtk_widget_destroy(widget);
+ // Make sure that Detach destroyed the widget.
+ DCHECK(!native_view());
}
} else if (!native_view()) {
if (GetWidget())
« no previous file with comments | « views/controls/native/native_view_host_wrapper.h ('k') | views/widget/widget_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698