summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmmanuele Bassi <ebassi@gnome.org>2013-03-05 00:48:11 +0000
committerEmmanuele Bassi <ebassi@gnome.org>2013-03-05 00:56:42 +0000
commite92331903d9fc55609cd5b215e4fd0d3b8de4635 (patch)
tree824408c0a152db2d131a70abf7146128bd37980e
parentfb09a07ac2dbe8d41c7e4e9f0bafa88de035a37c (diff)
downloadclutter-e92331903d9fc55609cd5b215e4fd0d3b8de4635.tar.gz
actor: Revert the Transition/Actor leak fix
The original code inside ClutterActor that dealt with Transitions stopping was written for the ::completed signal, thus the code was correctly handling the lifetime of the instances; when we moved to the ::stopped signal, we assumed that it worked in the same way - with less conditions to be checked, obviously, but fundamentally similar to the ::completed signal. Sadly, I screwed up the signal definition, and the signal ended up calling our handlers, but not the default one that did the cleanup and released references on the Animatable instance. After fixing the Timeline::stopped signal, we can go back to the previous code. Thanks to Craig Hughes for the help in tracking down this mess. https://bugzilla.gnome.org/show_bug.cgi?id=695158
-rw-r--r--clutter/clutter-actor.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/clutter/clutter-actor.c b/clutter/clutter-actor.c
index f59ec92d0..1c200d7fb 100644
--- a/clutter/clutter-actor.c
+++ b/clutter/clutter-actor.c
@@ -18493,6 +18493,9 @@ on_transition_stopped (ClutterTransition *transition,
info = _clutter_actor_get_animation_info (actor);
+ /* we need copies because we emit the signal after the
+ * TransitionClosure data structure has been freed
+ */
t_quark = g_quark_from_string (clos->name);
t_name = g_strdup (clos->name);
@@ -18505,12 +18508,12 @@ on_transition_stopped (ClutterTransition *transition,
g_object_ref (transition);
/* this is safe, because the timeline has now stopped,
- * so we won't recurse
+ * so we won't recurse; the reference on the Animatable
+ * will be dropped by the ::stopped signal closure in
+ * ClutterTransition, which is RUN_LAST, and thus will
+ * be called after this handler
*/
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