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

Unified Diff: views/widget/widget_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_control_gtk.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/widget/widget_gtk.cc
diff --git a/views/widget/widget_gtk.cc b/views/widget/widget_gtk.cc
index 8274e2d5445ce69f10240f06890f79ff3c7d6abc..f42f093dfa8b5d6b961b1a6a8eb41382efebadce 100644
--- a/views/widget/widget_gtk.cc
+++ b/views/widget/widget_gtk.cc
@@ -112,6 +112,7 @@ WidgetGtk::WidgetGtk(Type type)
}
WidgetGtk::~WidgetGtk() {
+ DCHECK(delete_on_destroy_ || widget_ == NULL);
if (type_ != TYPE_CHILD)
ActiveWindowWatcherX::RemoveObserver(this);
MessageLoopForUI::current()->RemoveObserver(this);
@@ -444,8 +445,10 @@ void WidgetGtk::Close() {
}
void WidgetGtk::CloseNow() {
- if (widget_)
+ if (widget_) {
gtk_widget_destroy(widget_);
+ widget_ = NULL;
+ }
}
void WidgetGtk::Show() {
« no previous file with comments | « views/controls/native_control_gtk.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698