hc
2025-02-14 bbb9540dc49f70f6b703d1c8d1b85fa5f602d86e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
From e1cb0a2c4fc9f0a36b0e0850300c7e592d92474c Mon Sep 17 00:00:00 2001
From: Jeffy Chen <jeffy.chen@rock-chips.com>
Date: Tue, 31 May 2022 12:32:18 +0800
Subject: [PATCH 66/66] desktop-shell: Fix crash when activating destroyed
 desktop surface
 
Tested with Qt's Windows Flags Example, by switching between Popup and
Tool repeatedly.
 
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
---
 desktop-shell/shell.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
 
diff --git a/desktop-shell/shell.c b/desktop-shell/shell.c
index bb5d02855..3e3949cba 100644
--- a/desktop-shell/shell.c
+++ b/desktop-shell/shell.c
@@ -3787,7 +3787,8 @@ activate(struct desktop_shell *shell, struct weston_view *view,
 
     main_surface = weston_surface_get_main_surface(es);
     shsurf = get_shell_surface(main_surface);
-    assert(shsurf);
+    if (!shsurf)
+        return;
 
     shsurf_child = get_last_child(shsurf);
     if (shsurf_child) {
-- 
2.20.1