HYL_OK3568_LINUX/buildroot/package/weston/0032-libweston-animation-Fix-double-destroy.patch
2025-05-10 21:49:39 +08:00

51 lines
1.7 KiB
Diff

From dffc021e58e7f75ede2be2c5be679da1c6782c28 Mon Sep 17 00:00:00 2001
From: Jeffy Chen <jeffy.chen@rock-chips.com>
Date: Fri, 9 Oct 2020 18:00:11 +0800
Subject: [PATCH 32/93] libweston: animation: Fix double-destroy
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
---
libweston/animation.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/libweston/animation.c b/libweston/animation.c
index f11754c..b228558 100644
--- a/libweston/animation.c
+++ b/libweston/animation.c
@@ -136,6 +136,7 @@ struct weston_view_animation {
weston_view_animation_frame_func_t frame;
weston_view_animation_frame_func_t reset;
weston_view_animation_done_func_t done;
+ struct wl_event_source *idle_destroy_source;
void *data;
void *private;
};
@@ -143,6 +144,9 @@ struct weston_view_animation {
WL_EXPORT void
weston_view_animation_destroy(struct weston_view_animation *animation)
{
+ if (animation->idle_destroy_source)
+ wl_event_source_remove(animation->idle_destroy_source);
+
wl_list_remove(&animation->animation.link);
wl_list_remove(&animation->listener.link);
wl_list_remove(&animation->transform.link);
@@ -248,10 +252,13 @@ weston_view_animation_create(struct weston_view *view,
if (view->output) {
wl_list_insert(&view->output->animation_list,
&animation->animation.link);
+ animation->idle_destroy_source = NULL;
} else {
wl_list_init(&animation->animation.link);
loop = wl_display_get_event_loop(ec->wl_display);
- wl_event_loop_add_idle(loop, idle_animation_destroy, animation);
+ animation->idle_destroy_source =
+ wl_event_loop_add_idle(loop, idle_animation_destroy,
+ animation);
}
return animation;
--
2.20.1