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>
This commit is contained in:
@@ -2607,11 +2607,30 @@ display_destroy_outputs(struct display *display)
|
|||||||
void
|
void
|
||||||
display_destroy(struct display *display)
|
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);
|
display_destroy_outputs(display);
|
||||||
|
|
||||||
fini_xkb(display);
|
fini_xkb(display);
|
||||||
fini_egl(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_flush(display->display);
|
||||||
wl_display_destroy(display->display);
|
wl_display_destroy(display->display);
|
||||||
free(display);
|
free(display);
|
||||||
|
|||||||
Reference in New Issue
Block a user