From eb2a12a92ca54a60ca88a5b3fa0521982a83a5ac Mon Sep 17 00:00:00 2001 From: Pekka Paalanen Date: Wed, 12 Apr 2023 15:00:50 +0300 Subject: [PATCH] xwayland: comment on cleanup_after_cairo() I tried this, and it causes a crash. Leave a note for the future when we happen to use some other backend with xwayland and find a "leak". The reason this is a comment and not a Gitlab issue is that you probably would not go looking for a Gitlab issue saying an idea is a bad one. This comment is more likely to be found. It's not really a leak either, it only needs to be fixed if you want a clean ASan leak report. Signed-off-by: Pekka Paalanen --- xwayland/window-manager.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/xwayland/window-manager.c b/xwayland/window-manager.c index 9f1f6b60..378c0123 100644 --- a/xwayland/window-manager.c +++ b/xwayland/window-manager.c @@ -2949,6 +2949,14 @@ weston_wm_destroy(struct weston_wm *wm) wl_list_remove(&wm->kill_listener.link); wl_list_remove(&wm->create_surface_listener.link); + /* + * No, you cannot call cleanup_after_cairo() here, because Weston + * on wayland-backend would crash in an assert inside Cairo. + * Just rely on headless and wayland backends calling it. + * + * XXX: fix this for other backends. + */ + free(wm); }