[evolution] EMenuBar: Ensure GSettings signal handler is removed on menu bar free



commit 07de579eebe52a6417c2f2862db0c8cfdf13e0a7
Author: Milan Crha <mcrha redhat com>
Date:   Thu Aug 4 17:23:40 2022 +0200

    EMenuBar: Ensure GSettings signal handler is removed on menu bar free
    
    Otherwise a use-after-free happens in the callback.

 src/e-util/e-menu-bar.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/e-util/e-menu-bar.c b/src/e-util/e-menu-bar.c
index d679aadf87..700142bb94 100644
--- a/src/e-util/e-menu-bar.c
+++ b/src/e-util/e-menu-bar.c
@@ -231,10 +231,10 @@ e_menu_bar_new (GtkMenuBar *inner_menu_bar,
        E_MENU_BAR (menu_bar)->priv->inner_menu_bar = GTK_WIDGET (inner_menu_bar);
 
        settings = e_util_ref_settings ("org.gnome.evolution.shell");
-       g_signal_connect (
+       g_signal_connect_object (
                settings, "changed::menubar-visible",
                G_CALLBACK (menu_bar_visible_settings_changed_cb),
-               menu_bar);
+               menu_bar, 0);
        e_menu_bar_set_visible (
                E_MENU_BAR (menu_bar),
                g_settings_get_boolean (settings, "menubar-visible"));


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