mirror of
https://gitlab.freedesktop.org/wayland/wayland.git
synced 2026-03-23 05:35:51 -04:00
server: fix abort when terminating display on wl_event_loop destroy
The destruction of wl_event_loop may trigger a call to wl_display_terminate() in user code. This would fail with EBADF because we close terminate_efd earlier in wl_display_destroy(). Close the FD after wl_event_loop_destroy() to avoid this issue. Add a test for this behavior. Signed-off-by: Simon Ser <contact@emersion.fr>
This commit is contained in:
parent
6c4a695045
commit
e37b321a82
2 changed files with 31 additions and 1 deletions
|
|
@ -1267,11 +1267,12 @@ wl_display_destroy(struct wl_display *display)
|
|||
wl_socket_destroy(s);
|
||||
}
|
||||
|
||||
close(display->terminate_efd);
|
||||
wl_event_source_remove(display->term_source);
|
||||
|
||||
wl_event_loop_destroy(display->loop);
|
||||
|
||||
close(display->terminate_efd);
|
||||
|
||||
wl_list_for_each_safe(global, gnext, &display->global_list, link)
|
||||
free(global);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue