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
This commit is contained in:
Emmanuele Bassi 2013-03-04 22:43:22 +00:00
parent 315a73edf5
commit f3659d35a0

View File

@ -18512,7 +18512,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);
@ -18545,9 +18547,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);
@ -18555,6 +18555,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