[gtk+] shortcutswindow: Unset search_bar in dispose
- From: Timm Bäder <baedert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] shortcutswindow: Unset search_bar in dispose
- Date: Fri, 20 Jan 2017 20:58:52 +0000 (UTC)
commit 2a84be4ae5f72f840c35237d4f4147084bb9da61
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]