mirror of
https://gitlab.freedesktop.org/plymouth/plymouth.git
synced 2026-05-08 13:38:45 +02:00
animaton: stop animation when freed
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.
This commit is contained in:
parent
2646c1b812
commit
fcf947fe7c
1 changed files with 6 additions and 0 deletions
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue