HYL_OK3568_LINUX/buildroot/package/weston/0069-desktop-shell-Fix-crash-when-destroying-uncommited-s.patch
2025-05-10 21:49:39 +08:00

32 lines
1008 B
Diff

From e0b016c5e52ca53c2359768cb3366fd191e37458 Mon Sep 17 00:00:00 2001
From: Jeffy Chen <jeffy.chen@rock-chips.com>
Date: Wed, 8 Jun 2022 09:53:19 +0800
Subject: [PATCH 69/92] desktop-shell: Fix crash when destroying uncommited
surface
By adding a sanity check for it's wsurface_anim_fade.
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
---
desktop-shell/shell.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/desktop-shell/shell.c b/desktop-shell/shell.c
index 2e88b99..1da402a 100644
--- a/desktop-shell/shell.c
+++ b/desktop-shell/shell.c
@@ -277,7 +277,9 @@ desktop_shell_destroy_surface(struct shell_surface *shsurf)
weston_view_destroy(shsurf->view);
wl_signal_emit(&shsurf->destroy_signal, shsurf);
- weston_surface_unref(shsurf->wsurface_anim_fade);
+
+ if (shsurf->wsurface_anim_fade)
+ weston_surface_unref(shsurf->wsurface_anim_fade);
if (shsurf->output_destroy_listener.notify) {
wl_list_remove(&shsurf->output_destroy_listener.link);
--
2.20.1