diff options
author | stevenjb@google.com <stevenjb@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-27 17:38:58 +0000 |
---|---|---|
committer | stevenjb@google.com <stevenjb@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-27 17:38:58 +0000 |
commit | efe77039058399d5234ed3d414312d958c94684e (patch) | |
tree | 4611b742428f8a5c686f39239d701cb13f863eff /views | |
parent | a292de2d3fe352ac20269572abb4407398c5eb3f (diff) | |
download | chromium_src-efe77039058399d5234ed3d414312d958c94684e.zip chromium_src-efe77039058399d5234ed3d414312d958c94684e.tar.gz chromium_src-efe77039058399d5234ed3d414312d958c94684e.tar.bz2 |
Set WidgetGtk.delegate_ = NULL in CloseNow() to fix chromium-os:5604.
BUG=http://code.google.com/p/chromium-os/issues/detail?id=5604
TEST=Ensure opening and closing widgets behaves normally. Check for further crashes in WidgetGtk::IsActiveChanged().
Review URL: http://codereview.chromium.org/3452025
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@60668 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views')
-rw-r--r-- | views/widget/widget_gtk.cc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/views/widget/widget_gtk.cc b/views/widget/widget_gtk.cc index 0045a19..5eee50f 100644 --- a/views/widget/widget_gtk.cc +++ b/views/widget/widget_gtk.cc @@ -700,8 +700,7 @@ void WidgetGtk::Close() { void WidgetGtk::CloseNow() { if (widget_) { - gtk_widget_destroy(widget_); - widget_ = NULL; + gtk_widget_destroy(widget_); // Triggers OnDestroy(). } } @@ -1229,7 +1228,10 @@ void WidgetGtk::OnGrabNotify(GtkWidget* widget, gboolean was_grabbed) { void WidgetGtk::OnDestroy(GtkWidget* object) { // Note that this handler is hooked to GtkObject::destroy. + // NULL out pointers here since we might still be in an observerer list + // until delstion happens. widget_ = window_contents_ = NULL; + delegate_ = NULL; if (delete_on_destroy_) { // Delays the deletion of this WidgetGtk as we want its children to have // access to it when destroyed. |