[mutter] clutter/transition: Don't split reference counting with actor



commit 2c388e2155ebdd55cda12add5e312b8757690c88
Author: Jonas Ådahl <jadahl gmail com>
Date:   Mon Oct 7 18:40:58 2019 +0200

    clutter/transition: Don't split reference counting with actor
    
    ClutterActor took a reference in its transition 'stopped' handler,
    aiming to keep the transition alive during signal emission even if it
    was removed during. This is, however, already taken care of by
    ClutterTimeline, by always taking a reference during its 'stopped'
    signal emission, so no need to add another one.
    
    This also has the bonus of making reference ownership simpler, as well
    as avoidance of double free if an actor was destroyed before a
    transition has finished.
    
    https://gitlab.gnome.org/GNOME/mutter/merge_requests/828

 clutter/clutter/clutter-actor.c      | 7 -------
 clutter/clutter/clutter-transition.c | 1 -
 2 files changed, 8 deletions(-)
---
diff --git a/clutter/clutter/clutter-actor.c b/clutter/clutter/clutter-actor.c
index 29adcc3f2..e763291a5 100644
--- a/clutter/clutter/clutter-actor.c
+++ b/clutter/clutter/clutter-actor.c
@@ -19521,13 +19521,6 @@ on_transition_stopped (ClutterTransition *transition,
 
   if (clutter_transition_get_remove_on_complete (transition))
     {
-      /* we take a reference here because removing the closure will release the
-       * reference on the transition, and we want the transition to survive the
-       * signal emission. It'll be unreferenced by the remove-on-complete
-       * handling in ClutterTransition::stopped.
-       */
-      g_object_ref (transition);
-
       /* this is safe, because the timeline has now stopped,
        * so we won't recurse; the reference on the Animatable
        * will be dropped by the ::stopped signal closure in
diff --git a/clutter/clutter/clutter-transition.c b/clutter/clutter/clutter-transition.c
index da5213eeb..34f357c48 100644
--- a/clutter/clutter/clutter-transition.c
+++ b/clutter/clutter/clutter-transition.c
@@ -134,7 +134,6 @@ clutter_transition_stopped (ClutterTimeline *timeline,
       clutter_transition_detach (CLUTTER_TRANSITION (timeline),
                                  priv->animatable);
       g_clear_object (&priv->animatable);
-      g_object_unref (timeline);
     }
 }
 


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