[gtk+] shortcutswindow: Make dispose work properly
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] shortcutswindow: Make dispose work properly
- Date: Wed, 11 Jan 2017 17:36:45 +0000 (UTC)
commit b8371a1d61f127ef186d90990040956235f82bec
Author: Benjamin Otte <otte redhat com>
Date: Tue Jan 10 15:59:26 2017 +0100
shortcutswindow: Make dispose work properly
gtk/gtkshortcutswindow.c | 14 +++++++-------
1 files changed, 7 insertions(+), 7 deletions(-)
---
diff --git a/gtk/gtkshortcutswindow.c b/gtk/gtkshortcutswindow.c
index dbe6419..86d9532 100644
--- a/gtk/gtkshortcutswindow.c
+++ b/gtk/gtkshortcutswindow.c
@@ -654,26 +654,26 @@ gtk_shortcuts_window_dispose (GObject *object)
GtkShortcutsWindow *self = (GtkShortcutsWindow *)object;
GtkShortcutsWindowPrivate *priv = gtk_shortcuts_window_get_instance_private (self);
- g_signal_handlers_disconnect_by_func (priv->stack, G_CALLBACK (update_title_stack), self);
+ if (priv->stack)
+ g_signal_handlers_disconnect_by_func (priv->stack, G_CALLBACK (update_title_stack), self);
gtk_shortcuts_window_set_window (self, NULL);
if (priv->header_bar)
{
- gtk_widget_destroy (GTK_WIDGET (priv->header_bar));
+ gtk_container_remove (GTK_CONTAINER (self), GTK_WIDGET (priv->header_bar));
priv->header_bar = NULL;
priv->popover = NULL;
}
- G_OBJECT_CLASS (gtk_shortcuts_window_parent_class)->dispose (object);
-
-#if 0
if (priv->main_box)
{
- gtk_widget_destroy (GTK_WIDGET (priv->main_box));
+ gtk_container_remove (GTK_CONTAINER (self), GTK_WIDGET (priv->main_box));
priv->main_box = NULL;
+ priv->stack = NULL;
}
-#endif
+
+ G_OBJECT_CLASS (gtk_shortcuts_window_parent_class)->dispose (object);
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]