1From ad193916801ae06bea8f8f7b3c6a51d50aac2014 Mon Sep 17 00:00:00 2001
2From: Jeffy Chen <jeffy.chen@rock-chips.com>
3Date: Wed, 8 Jun 2022 09:53:19 +0800
4Subject: [PATCH 70/93] desktop-shell: Fix crash when destroying uncommited
5 surface
6
7By adding a sanity check for it's wsurface_anim_fade.
8
9Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
10---
11 desktop-shell/shell.c | 4 +++-
12 1 file changed, 3 insertions(+), 1 deletion(-)
13
14diff --git a/desktop-shell/shell.c b/desktop-shell/shell.c
15index 2e88b99..1da402a 100644
16--- a/desktop-shell/shell.c
17+++ b/desktop-shell/shell.c
18@@ -277,7 +277,9 @@ desktop_shell_destroy_surface(struct shell_surface *shsurf)
19 	weston_view_destroy(shsurf->view);
20
21 	wl_signal_emit(&shsurf->destroy_signal, shsurf);
22-	weston_surface_unref(shsurf->wsurface_anim_fade);
23+
24+	if (shsurf->wsurface_anim_fade)
25+		weston_surface_unref(shsurf->wsurface_anim_fade);
26
27 	if (shsurf->output_destroy_listener.notify) {
28 		wl_list_remove(&shsurf->output_destroy_listener.link);
29--
302.20.1
31
32