]> git.ipfire.org Git - thirdparty/plymouth.git/commitdiff
animaton: stop animation when freed
authorRay Strode <rstrode@redhat.com>
Wed, 24 Oct 2012 17:08:41 +0000 (13:08 -0400)
committerRay Strode <rstrode@redhat.com>
Wed, 24 Oct 2012 17:13:28 +0000 (13:13 -0400)
It's possible that an animation could get freed before it finishes.
In that case, finish the animation right away, so we don't keep running the
animation timeout on freed memory.

src/libply-splash-graphics/ply-animation.c

index f266c2e4a3fdeb577030ca3c378ca8f511f883ca..ed558cfee1892b73b284a1c8ae0418676ec02482 100644 (file)
@@ -73,6 +73,9 @@ struct _ply_animation
   uint32_t stop_requested : 1;
 };
 
+static void ply_animation_stop_now (ply_animation_t *animation);
+
+
 ply_animation_t *
 ply_animation_new (const char *image_dir,
                    const char *frames_prefix)
@@ -118,6 +121,9 @@ ply_animation_free (ply_animation_t *animation)
   if (animation == NULL)
     return;
 
+  if (!animation->is_stopped)
+    ply_animation_stop_now (animation);
+
   ply_animation_remove_frames (animation);
   ply_array_free (animation->frames);