bar/wayland: close command pipe FDs in cleanup

This commit is contained in:
Daniel Eklöf 2020-10-29 18:03:14 +01:00
parent 328ebe8fe9
commit 008235d904
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

View file

@ -136,7 +136,9 @@ seat_destroy(struct seat *seat)
void *
bar_backend_wayland_new(void)
{
return calloc(1, sizeof(struct wayland_backend));
struct wayland_backend *backend = calloc(1, sizeof(struct wayland_backend));
backend->pipe_fds[0] = backend->pipe_fds[1] = -1;
return backend;
}
static void
@ -949,6 +951,11 @@ cleanup(struct bar *_bar)
struct private *bar = _bar->private;
struct wayland_backend *backend = bar->backend.data;
if (backend->pipe_fds[0] >= 0)
close(backend->pipe_fds[0]);
if (backend->pipe_fds[1] >= 0)
close(backend->pipe_fds[1]);
tll_foreach(backend->buffers, it) {
if (it->item.wl_buf != NULL)
wl_buffer_destroy(it->item.wl_buf);