[gnome-flashback/gnome-3-30] notifications: fix crash when removing monitor



commit d91c04a2cf373f108b6534d4ab40057ee8a709e6
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date:   Mon Sep 10 21:39:23 2018 +0300

    notifications: fix crash when removing monitor
    
    When bubble is added to stack we connect to destroy signal to
    remove bubble from stack when it is destroyed. When we move same
    bubble to other stack old signal handler remains connected and
    we end with destroy callback using already freed stack.
    
    Use g_signal_connect_object to make sure that signal handler is
    disconnected when stack is destroyed.

 gnome-flashback/libnotifications/nd-stack.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
---
diff --git a/gnome-flashback/libnotifications/nd-stack.c b/gnome-flashback/libnotifications/nd-stack.c
index bc707a0..4a3d02c 100644
--- a/gnome-flashback/libnotifications/nd-stack.c
+++ b/gnome-flashback/libnotifications/nd-stack.c
@@ -436,10 +436,9 @@ nd_stack_add_bubble (NdStack  *stack,
         gtk_window_move (GTK_WINDOW (bubble), x, y);
 
         if (new_notification) {
-                g_signal_connect_swapped (G_OBJECT (bubble),
-                                          "destroy",
-                                          G_CALLBACK (nd_stack_remove_bubble),
-                                          stack);
+                g_signal_connect_object (bubble, "destroy",
+                                         G_CALLBACK (nd_stack_remove_bubble), stack,
+                                         G_CONNECT_SWAPPED);
                 stack->priv->bubbles = g_list_prepend (stack->priv->bubbles, bubble);
         }
 }


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