From abd7292969eb044bfe6bb67ae31bf11b9c1e7c4b Mon Sep 17 00:00:00 2001 From: Pekka Paalanen Date: Mon, 24 May 2021 14:42:00 +0300 Subject: [PATCH] desktop-shell: destroy weston_desktop Plugs ASan reported leaks: Direct leak of 88 byte(s) in 1 object(s) allocated from: #0 0x7f338f70a518 in calloc (/lib/x86_64-linux-gnu/libasan.so.5+0xe9518) #1 0x7f338afe22f3 in zalloc ../../git/weston/include/libweston/zalloc.h:38 #2 0x7f338afe3cc2 in weston_desktop_xwayland_init ../../git/weston/libweston-desktop/xwayland.c:410 #3 0x7f338afdbaef in weston_desktop_create ../../git/weston/libweston-desktop/libweston-desktop.c:87 #4 0x7f338b148d39 in wet_shell_init ../../git/weston/desktop-shell/shell.c:5224 #5 0x7f338f5e9de5 in wet_load_shell ../../git/weston/compositor/main.c:956 #6 0x7f338f5fadb9 in wet_main ../../git/weston/compositor/main.c:3434 #7 0x5646d2392fc6 in execute_compositor ../../git/weston/tests/weston-test-fixture-compositor.c:432 #8 0x5646d23969fa in weston_test_harness_execute_as_client ../../git/weston/tests/weston-test-runner.c:528 #9 0x5646d2386bd6 in fixture_setup ../../git/weston/tests/viewporter-test.c:46 #10 0x5646d2386c58 in fixture_setup_run_ ../../git/weston/tests/viewporter-test.c:48 #11 0x5646d2396faf in main ../../git/weston/tests/weston-test-runner.c:661 #12 0x7f338f25f09a in __libc_start_main ../csu/libc-start.c:308 #13 0x5646d2386769 in _start (/home/pq/build/weston-meson/tests/test-viewporter+0xc769) Indirect leak of 152 byte(s) in 1 object(s) allocated from: #0 0x7f338f70a518 in calloc (/lib/x86_64-linux-gnu/libasan.so.5+0xe9518) #1 0x7f338afdb811 in zalloc ../../git/weston/include/libweston/zalloc.h:38 #2 0x7f338afdb92d in weston_desktop_create ../../git/weston/libweston-desktop/libweston-desktop.c:65 #3 0x7f338b148d39 in wet_shell_init ../../git/weston/desktop-shell/shell.c:5224 #4 0x7f338f5e9de5 in wet_load_shell ../../git/weston/compositor/main.c:956 #5 0x7f338f5fadb9 in wet_main ../../git/weston/compositor/main.c:3434 #6 0x5646d2392fc6 in execute_compositor ../../git/weston/tests/weston-test-fixture-compositor.c:432 #7 0x5646d23969fa in weston_test_harness_execute_as_client ../../git/weston/tests/weston-test-runner.c:528 #8 0x5646d2386bd6 in fixture_setup ../../git/weston/tests/viewporter-test.c:46 #9 0x5646d2386c58 in fixture_setup_run_ ../../git/weston/tests/viewporter-test.c:48 #10 0x5646d2396faf in main ../../git/weston/tests/weston-test-runner.c:661 #11 0x7f338f25f09a in __libc_start_main ../csu/libc-start.c:308 #12 0x5646d2386769 in _start (/home/pq/build/weston-meson/tests/test-viewporter+0xc769) Indirect leak of 72 byte(s) in 1 object(s) allocated from: #0 0x7f338f70a518 in calloc (/lib/x86_64-linux-gnu/libasan.so.5+0xe9518) #1 0x7f338afdc5ae in zalloc ../../git/weston/include/libweston/zalloc.h:38 #2 0x7f338afdc89e in weston_desktop_client_create ../../git/weston/libweston-desktop/client.c:108 #3 0x7f338afe3d2a in weston_desktop_xwayland_init ../../git/weston/libweston-desktop/xwayland.c:415 #4 0x7f338afdbaef in weston_desktop_create ../../git/weston/libweston-desktop/libweston-desktop.c:87 #5 0x7f338b148d39 in wet_shell_init ../../git/weston/desktop-shell/shell.c:5224 #6 0x7f338f5e9de5 in wet_load_shell ../../git/weston/compositor/main.c:956 #7 0x7f338f5fadb9 in wet_main ../../git/weston/compositor/main.c:3434 #8 0x5646d2392fc6 in execute_compositor ../../git/weston/tests/weston-test-fixture-compositor.c:432 #9 0x5646d23969fa in weston_test_harness_execute_as_client ../../git/weston/tests/weston-test-runner.c:528 #10 0x5646d2386bd6 in fixture_setup ../../git/weston/tests/viewporter-test.c:46 #11 0x5646d2386c58 in fixture_setup_run_ ../../git/weston/tests/viewporter-test.c:48 #12 0x5646d2396faf in main ../../git/weston/tests/weston-test-runner.c:661 #13 0x7f338f25f09a in __libc_start_main ../csu/libc-start.c:308 #14 0x5646d2386769 in _start (/home/pq/build/weston-meson/tests/test-viewporter+0xc769) Oops. Signed-off-by: Pekka Paalanen --- desktop-shell/shell.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/desktop-shell/shell.c b/desktop-shell/shell.c index 53abc596..9cc1844b 100644 --- a/desktop-shell/shell.c +++ b/desktop-shell/shell.c @@ -5024,6 +5024,8 @@ shell_destroy(struct wl_listener *listener, void *data) wl_list_remove(&shell->output_move_listener.link); wl_list_remove(&shell->resized_listener.link); + weston_desktop_destroy(shell->desktop); + wl_array_for_each(ws, &shell->workspaces.array) workspace_destroy(*ws); wl_array_release(&shell->workspaces.array);