From c20529846ed1f0825ed8a07e6e262190ab903009 Mon Sep 17 00:00:00 2001 From: Pekka Paalanen Date: Fri, 16 Dec 2011 11:41:32 +0200 Subject: [PATCH] window: destroy misc objects on display_destroy() Windows are supposed to be destroyed by the application explicitly. Deferred tasks are not supposed to be added after returning from display_run(). Destroy remaining wl objects (except input related will be in a following patch). Close the epoll fd. Signed-off-by: Pekka Paalanen --- clients/window.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/clients/window.c b/clients/window.c index c1aee89e..9b557dd6 100644 --- a/clients/window.c +++ b/clients/window.c @@ -2607,11 +2607,30 @@ display_destroy_outputs(struct display *display) void display_destroy(struct display *display) { + if (!wl_list_empty(&display->window_list)) + fprintf(stderr, "toytoolkit warning: windows exist.\n"); + + if (!wl_list_empty(&display->deferred_list)) + fprintf(stderr, "toytoolkit warning: deferred tasks exist.\n"); + display_destroy_outputs(display); fini_xkb(display); fini_egl(display); + if (display->shell) + wl_shell_destroy(display->shell); + + if (display->shm) + wl_shm_destroy(display->shm); + + if (display->data_device_manager) + wl_data_device_manager_destroy(display->data_device_manager); + + wl_compositor_destroy(display->compositor); + + close(display->epoll_fd); + wl_display_flush(display->display); wl_display_destroy(display->display); free(display);