diff options
author | Emmanuele Bassi <ebassi@gnome.org> | 2013-03-04 22:43:22 +0000 |
---|---|---|
committer | Emmanuele Bassi <ebassi@gnome.org> | 2013-03-04 23:13:22 +0000 |
commit | 8e5c03d85839f0b3924aa70e255b86173159a860 (patch) | |
tree | b0acde7a3652473c4f8d1871b53d338247178cf4 | |
parent | ba1ff388b1d83a7618714a5c3fc3f266c7c30ca4 (diff) | |
download | clutter-8e5c03d85839f0b3924aa70e255b86173159a860.tar.gz |
actor: Release a reference on the implicit Transitions
When stopping the transition we need to release the reference we
maintain while removing the Transition from the hash table inside an
actor. If we fail to do so, the Transition is never released, which
means we leak the Animatable instance we tied to it.
https://bugzilla.gnome.org/show_bug.cgi?id=695158
-rw-r--r-- | clutter/clutter-actor.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/clutter/clutter-actor.c b/clutter/clutter-actor.c index 404776dd6..be6ca9b41 100644 --- a/clutter/clutter-actor.c +++ b/clutter/clutter-actor.c @@ -18470,7 +18470,9 @@ transition_closure_free (gpointer data) if (clutter_timeline_is_playing (timeline)) clutter_timeline_stop (timeline); + /* remove the reference added in add_transition_internal() */ g_object_unref (clos->transition); + g_free (clos->name); g_slice_free (TransitionClosure, clos); @@ -18502,9 +18504,7 @@ on_transition_stopped (ClutterTransition *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; - * the master clock will release the last reference at - * the end of the frame processing. + * want the transition to survive the signal emission */ g_object_ref (transition); @@ -18512,6 +18512,9 @@ on_transition_stopped (ClutterTransition *transition, * so we won't recurse */ g_hash_table_remove (info->transitions, clos->name); + + /* we can release the reference here */ + g_object_unref (transition); } /* we emit the ::transition-stopped after removing the |