[gtk+/wip/baedert/visible-widgets: 10/11] shortcutswindow: Unset search_bar in dispose



commit c188837b5da642d26acaed461f9732ee093df9da
Author: Timm Bäder <mail baedert org>
Date:   Thu Jan 12 17:13:19 2017 +0100

    shortcutswindow: Unset search_bar in dispose
    
    And check for null-ness in unmap. This prevents a crash when the window
    is first disposed and then unmapped.

 gtk/gtkshortcutswindow.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtkshortcutswindow.c b/gtk/gtkshortcutswindow.c
index bcdc49a..952b01d 100644
--- a/gtk/gtkshortcutswindow.c
+++ b/gtk/gtkshortcutswindow.c
@@ -669,6 +669,7 @@ gtk_shortcuts_window_dispose (GObject *object)
       gtk_container_remove (GTK_CONTAINER (self), GTK_WIDGET (priv->main_box));
       priv->main_box = NULL;
       priv->stack = NULL;
+      priv->search_bar = NULL;
     }
 
   G_OBJECT_CLASS (gtk_shortcuts_window_parent_class)->dispose (object);
@@ -739,7 +740,8 @@ gtk_shortcuts_window_unmap (GtkWidget *widget)
   GtkShortcutsWindow *self = (GtkShortcutsWindow *)widget;
   GtkShortcutsWindowPrivate *priv = gtk_shortcuts_window_get_instance_private (self);
 
-  gtk_search_bar_set_search_mode (priv->search_bar, FALSE);
+  if (priv->search_bar)
+    gtk_search_bar_set_search_mode (priv->search_bar, FALSE);
 
   GTK_WIDGET_CLASS (gtk_shortcuts_window_parent_class)->unmap (widget);
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]