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.
This commit is contained in:
Dominique Martinet 2017-08-19 09:26:25 +02:00
parent 4da976bfad
commit 5885679e33
9 changed files with 21 additions and 12 deletions

View file

@ -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);
}