mirror of
https://github.com/brl/mutter.git
synced 2024-12-23 19:42:05 +00:00
[animation] Do not connect to ::completed multiple times
The clutter_actor_animate*() family of functions should only connect to the Animation::completed signal once, during the construction of the Animation object attached to the Actor. Otherwise, the completed signal handler will be run multiple times, and will try to unref() the Animation for each call -- leading to a segmentation fault.
This commit is contained in:
parent
6bf883da6c
commit
a1cc1f57ac
@ -1445,10 +1445,6 @@ clutter_animation_setupv (ClutterAnimation *animation,
|
|||||||
&values[i],
|
&values[i],
|
||||||
pspec);
|
pspec);
|
||||||
}
|
}
|
||||||
|
|
||||||
g_signal_connect (animation, "completed",
|
|
||||||
G_CALLBACK (on_animation_completed),
|
|
||||||
NULL);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -1508,10 +1504,6 @@ clutter_animation_setup_valist (ClutterAnimation *animation,
|
|||||||
|
|
||||||
property_name = va_arg (var_args, gchar*);
|
property_name = va_arg (var_args, gchar*);
|
||||||
}
|
}
|
||||||
|
|
||||||
g_signal_connect (animation, "completed",
|
|
||||||
G_CALLBACK (on_animation_completed),
|
|
||||||
NULL);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -1562,6 +1554,11 @@ clutter_actor_animate_with_alpha (ClutterActor *actor,
|
|||||||
if (G_LIKELY (!animation))
|
if (G_LIKELY (!animation))
|
||||||
{
|
{
|
||||||
animation = clutter_animation_new ();
|
animation = clutter_animation_new ();
|
||||||
|
|
||||||
|
g_signal_connect (animation, "completed",
|
||||||
|
G_CALLBACK (on_animation_completed),
|
||||||
|
NULL);
|
||||||
|
|
||||||
CLUTTER_NOTE (ANIMATION, "Created new Animation [%p]", animation);
|
CLUTTER_NOTE (ANIMATION, "Created new Animation [%p]", animation);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -1622,6 +1619,11 @@ clutter_actor_animate_with_timeline (ClutterActor *actor,
|
|||||||
if (G_LIKELY (!animation))
|
if (G_LIKELY (!animation))
|
||||||
{
|
{
|
||||||
animation = clutter_animation_new ();
|
animation = clutter_animation_new ();
|
||||||
|
|
||||||
|
g_signal_connect (animation, "completed",
|
||||||
|
G_CALLBACK (on_animation_completed),
|
||||||
|
NULL);
|
||||||
|
|
||||||
CLUTTER_NOTE (ANIMATION, "Created new Animation [%p]", animation);
|
CLUTTER_NOTE (ANIMATION, "Created new Animation [%p]", animation);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -1816,6 +1818,10 @@ clutter_actor_animate (ClutterActor *actor,
|
|||||||
clutter_animation_set_alpha (animation, NULL);
|
clutter_animation_set_alpha (animation, NULL);
|
||||||
clutter_animation_set_object (animation, G_OBJECT (actor));
|
clutter_animation_set_object (animation, G_OBJECT (actor));
|
||||||
|
|
||||||
|
g_signal_connect (animation, "completed",
|
||||||
|
G_CALLBACK (on_animation_completed),
|
||||||
|
NULL);
|
||||||
|
|
||||||
CLUTTER_NOTE (ANIMATION, "Created new Animation [%p]", animation);
|
CLUTTER_NOTE (ANIMATION, "Created new Animation [%p]", animation);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -1891,6 +1897,10 @@ clutter_actor_animatev (ClutterActor *actor,
|
|||||||
clutter_animation_set_alpha (animation, NULL);
|
clutter_animation_set_alpha (animation, NULL);
|
||||||
clutter_animation_set_object (animation, G_OBJECT (actor));
|
clutter_animation_set_object (animation, G_OBJECT (actor));
|
||||||
|
|
||||||
|
g_signal_connect (animation, "completed",
|
||||||
|
G_CALLBACK (on_animation_completed),
|
||||||
|
NULL);
|
||||||
|
|
||||||
CLUTTER_NOTE (ANIMATION, "Created new Animation [%p]", animation);
|
CLUTTER_NOTE (ANIMATION, "Created new Animation [%p]", animation);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -1958,6 +1968,11 @@ clutter_actor_animate_with_timelinev (ClutterActor *actor,
|
|||||||
if (G_LIKELY (!animation))
|
if (G_LIKELY (!animation))
|
||||||
{
|
{
|
||||||
animation = clutter_animation_new ();
|
animation = clutter_animation_new ();
|
||||||
|
|
||||||
|
g_signal_connect (animation, "completed",
|
||||||
|
G_CALLBACK (on_animation_completed),
|
||||||
|
NULL);
|
||||||
|
|
||||||
CLUTTER_NOTE (ANIMATION, "Created new Animation [%p]", animation);
|
CLUTTER_NOTE (ANIMATION, "Created new Animation [%p]", animation);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -2030,6 +2045,11 @@ clutter_actor_animate_with_alphav (ClutterActor *actor,
|
|||||||
if (G_LIKELY (!animation))
|
if (G_LIKELY (!animation))
|
||||||
{
|
{
|
||||||
animation = clutter_animation_new ();
|
animation = clutter_animation_new ();
|
||||||
|
|
||||||
|
g_signal_connect (animation, "completed",
|
||||||
|
G_CALLBACK (on_animation_completed),
|
||||||
|
NULL);
|
||||||
|
|
||||||
CLUTTER_NOTE (ANIMATION, "Created new Animation [%p]", animation);
|
CLUTTER_NOTE (ANIMATION, "Created new Animation [%p]", animation);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user