[evince] shell: Disconnect bookmarks signal on toolbar dispose



commit 086196f9b8c02aa7e1950d981299141c0bfa0f8d
Author: Jason Crain <jcrain src gnome org>
Date:   Tue Jul 10 01:53:51 2018 -0500

    shell: Disconnect bookmarks signal on toolbar dispose
    
    Fullscreen mode creates and deletes a toolbar. The toolbar shouldn't
    receive signals after it is destructed.
    
    Fixes https://gitlab.gnome.org/GNOME/evince/issues/920

 shell/ev-toolbar.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
---
diff --git a/shell/ev-toolbar.c b/shell/ev-toolbar.c
index 581aef8f..10e43789 100644
--- a/shell/ev-toolbar.c
+++ b/shell/ev-toolbar.c
@@ -275,6 +275,22 @@ ev_toolbar_constructed (GObject *object)
         g_object_unref (builder);
 }
 
+static void
+ev_toolbar_dispose (GObject *object)
+{
+        EvToolbar  *ev_toolbar = EV_TOOLBAR (object);
+        GMenuModel *bookmarks_submenu_model;
+
+        bookmarks_submenu_model = ev_window_get_bookmarks_menu (ev_toolbar->priv->window);
+        if (bookmarks_submenu_model) {
+                g_signal_handlers_disconnect_by_func (bookmarks_submenu_model,
+                                                      ev_toolbar_bookmarks_menu_model_changed,
+                                                      ev_toolbar);
+        }
+
+        G_OBJECT_CLASS (ev_toolbar_parent_class)->dispose (object);
+}
+
 static void
 ev_toolbar_class_init (EvToolbarClass *klass)
 {
@@ -282,6 +298,7 @@ ev_toolbar_class_init (EvToolbarClass *klass)
 
         g_object_class->set_property = ev_toolbar_set_property;
         g_object_class->constructed = ev_toolbar_constructed;
+        g_object_class->dispose = ev_toolbar_dispose;
 
         g_object_class_install_property (g_object_class,
                                          PROP_WINDOW,


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