[gnome-flashback] notifications: fix crash when removing monitor
- From: Alberts Muktupāvels <muktupavels src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-flashback] notifications: fix crash when removing monitor
- Date: Wed, 12 Sep 2018 11:54:44 +0000 (UTC)
commit be52844d0ce6253750f63c6496e18df05b436933
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 7d6ab6f..574e8a1 100644
--- a/gnome-flashback/libnotifications/nd-stack.c
+++ b/gnome-flashback/libnotifications/nd-stack.c
@@ -320,10 +320,9 @@ nd_stack_add_bubble (NdStack *stack,
gtk_widget_show (GTK_WIDGET (bubble));
gtk_window_move (GTK_WINDOW (bubble), x, y);
- 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]