From 5885679e33b4082e727fb55e1700b67159ec9d06 Mon Sep 17 00:00:00 2001 From: Dominique Martinet Date: Sat, 19 Aug 2017 09:26:25 +0200 Subject: examples: separate compositor_fini from run compositor_fini destroys the display, but it is an error to destroy it before e.g. wlr_seat that references it. This lets us order destroy calls properly, following first-in-last-out logic. --- examples/compositor/main.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'examples/compositor') diff --git a/examples/compositor/main.c b/examples/compositor/main.c index fdc4ed67..4c6e213d 100644 --- a/examples/compositor/main.c +++ b/examples/compositor/main.c @@ -178,9 +178,13 @@ int main() { break; } - compositor_run(&compositor); + wl_display_run(compositor.display); - wlr_wl_shell_destroy(state.wl_shell); - wlr_xdg_shell_v6_destroy(state.xdg_shell); close(state.keymap_fd); + wlr_seat_destroy(state.wl_seat); + wlr_data_device_manager_destroy(state.data_device_manager); + wlr_xdg_shell_v6_destroy(state.xdg_shell); + wlr_wl_shell_destroy(state.wl_shell); + wlr_renderer_destroy(state.renderer); + compositor_fini(&compositor); } -- cgit v1.2.3