Right now if a user calls ply_throbber_stop or ply_animation_stop
after the animation is stopped things malfunction. In the case
of the throbber we end up never calling the stop completion handler
passed in, and in the case of the animation, we end up setting
some state that shouldn't be set.
This commit checks if the animation and throbber objects are stopped,
and if so does the necessary steps to process the late stop request.
Spotted by Dave Airlie
void
ply_animation_stop (ply_animation_t *animation)
{
+ if (animation->is_stopped) {
+ ply_trace ("animation already stopped, ignoring stop request");
+ return;
+ }
+
if (animation->stop_trigger == NULL) {
ply_animation_stop_now (animation);
return;
ply_throbber_stop (ply_throbber_t *throbber,
ply_trigger_t *stop_trigger)
{
+ if (throbber->is_stopped) {
+ ply_trace ("throbber already stopped");
+ if (stop_trigger != NULL) {
+ ply_trace ("pulling stop trigger right away");
+ ply_trigger_pull (stop_trigger, NULL);
+ }
+ return;
+ }
+
if (stop_trigger == NULL) {
ply_throbber_stop_now (throbber);
return;