[mutter/gnome-3-34] clutter/cally-root: Use g_clear_signal_handler and fix a signal leak



commit 9c372388da260be724cc5239cd3202124ec4a1d7
Author: Robert Mader <robert mader posteo de>
Date:   Sun Nov 17 15:55:06 2019 +0100

    clutter/cally-root: Use g_clear_signal_handler and fix a signal leak
    
    This commit was split out from `cleanup: Use g_clear_signal_handler()
    where possible` as it fixes an actual signal leak and should therefore
    get backported to stable releases.
    
    https://gitlab.gnome.org/GNOME/mutter/merge_requests/940

 clutter/clutter/cally/cally-root.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)
---
diff --git a/clutter/clutter/cally/cally-root.c b/clutter/clutter/cally/cally-root.c
index 2f16296bc..34473fcd7 100644
--- a/clutter/clutter/cally/cally-root.c
+++ b/clutter/clutter/cally/cally-root.c
@@ -75,8 +75,8 @@ struct _CallyRootPrivate
   GSList *stage_list;
 
   /* signals id */
-  guint stage_added_id;
-  guint stage_removed_id;
+  gulong stage_added_id;
+  gulong stage_removed_id;
 };
 
 G_DEFINE_TYPE_WITH_PRIVATE (CallyRoot, cally_root,  ATK_TYPE_GOBJECT_ACCESSIBLE)
@@ -149,11 +149,9 @@ cally_root_finalize (GObject *object)
 
   stage_manager = atk_gobject_accessible_get_object (ATK_GOBJECT_ACCESSIBLE (root));
 
-  g_signal_handler_disconnect (stage_manager,
-                               root->priv->stage_added_id);
+  g_clear_signal_handler (&root->priv->stage_added_id, stage_manager);
 
-  g_signal_handler_disconnect (stage_manager,
-                               root->priv->stage_added_id);
+  g_clear_signal_handler (&root->priv->stage_removed_id, stage_manager);
 
   G_OBJECT_CLASS (cally_root_parent_class)->finalize (object);
 }


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