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 <ppaalanen@gmail.com>
dev
Pekka Paalanen 13 years ago
parent 2c1426a72f
commit c20529846e
  1. 19
      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);

Loading…
Cancel
Save