From 008235d904801466a6458c07162f2d77022bfce9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Thu, 29 Oct 2020 18:03:14 +0100 Subject: [PATCH] bar/wayland: close command pipe FDs in cleanup --- bar/wayland.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/bar/wayland.c b/bar/wayland.c index 35355c4..f4b3cce 100644 --- a/bar/wayland.c +++ b/bar/wayland.c @@ -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);