summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJack Mitchell <jmitchell@brightsign.biz>2023-09-27 16:46:58 +0100
committerDudemanguy <random342@airmail.cc>2023-09-27 16:17:31 +0000
commit1b4627f6470e94636932987844bafc939ec9281a (patch)
tree5697298d34f76ffdd4ab4252bf5c0e2162d0d775
parent1d00aee8e191c9689a20e67e3d6dfd2af6ad2588 (diff)
downloadmpv-1b4627f6470e94636932987844bafc939ec9281a.tar.bz2
mpv-1b4627f6470e94636932987844bafc939ec9281a.tar.xz
wayland: don't double close display fd
Calling wl_display_disconnect closes the file descriptor, no need to manually do it ourselves beforehand which causes a double close on the fd. Signed-off-by: Jack Mitchell <jack.mitchell@tuxable.co.uk>
-rw-r--r--video/out/wayland_common.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/video/out/wayland_common.c b/video/out/wayland_common.c
index 6072a9e58c..e113d47ffd 100644
--- a/video/out/wayland_common.c
+++ b/video/out/wayland_common.c
@@ -1971,8 +1971,7 @@ static void wayland_dispatch_events(struct vo_wayland_state *wl, int nfds, int t
}
if (fds[0].revents & (POLLERR | POLLHUP | POLLNVAL)) {
- MP_FATAL(wl, "Error occurred on the display fd, closing\n");
- close(wl->display_fd);
+ MP_FATAL(wl, "Error occurred on the display fd\n");
wl->display_fd = -1;
mp_input_put_key(wl->vo->input_ctx, MP_KEY_CLOSE_WIN);
}
@@ -2539,10 +2538,8 @@ void vo_wayland_uninit(struct vo *vo)
wl_list_for_each_safe(output, tmp, &wl->output_list, link)
remove_output(output);
- if (wl->display) {
- close(wl_display_get_fd(wl->display));
+ if (wl->display)
wl_display_disconnect(wl->display);
- }
munmap(wl->format_map, wl->format_size);