[libhandy/wip/exalm/fixes2: 13/13] view-switcher-title: Null-check view switcher in dispose()
- From: Adrien Plazas <aplazas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libhandy/wip/exalm/fixes2: 13/13] view-switcher-title: Null-check view switcher in dispose()
- Date: Wed, 27 May 2020 11:08:44 +0000 (UTC)
commit 9efa3a92e748f012bc32b9be482f19ebe71c8cd2
Author: Alexander Mikhaylenko <alexm gnome org>
Date: Tue Mar 24 21:05:35 2020 +0500
view-switcher-title: Null-check view switcher in dispose()
If it's NULL, we can't get the stack anymore. This can happen if
dispose() is called multiple times.
src/hdy-view-switcher-title.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
---
diff --git a/src/hdy-view-switcher-title.c b/src/hdy-view-switcher-title.c
index b6b22447..8d35a6fc 100644
--- a/src/hdy-view-switcher-title.c
+++ b/src/hdy-view-switcher-title.c
@@ -293,10 +293,13 @@ static void
hdy_view_switcher_title_dispose (GObject *object) {
HdyViewSwitcherTitle *self = (HdyViewSwitcherTitle *)object;
HdyViewSwitcherTitlePrivate *priv = hdy_view_switcher_title_get_instance_private (self);
- GtkStack *stack = hdy_view_switcher_get_stack (priv->view_switcher);
- if (stack)
- g_signal_handlers_disconnect_by_func (stack, G_CALLBACK (update_view_switcher_visible), self);
+ if (priv->view_switcher) {
+ GtkStack *stack = hdy_view_switcher_get_stack (priv->view_switcher);
+
+ if (stack)
+ g_signal_handlers_disconnect_by_func (stack, G_CALLBACK (update_view_switcher_visible), self);
+ }
G_OBJECT_CLASS (hdy_view_switcher_title_parent_class)->dispose (object);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]