forked from external/yambar
bar/wayland: close command pipe FDs in cleanup
This commit is contained in:
parent
328ebe8fe9
commit
008235d904
1 changed files with 8 additions and 1 deletions
|
@ -136,7 +136,9 @@ seat_destroy(struct seat *seat)
|
||||||
void *
|
void *
|
||||||
bar_backend_wayland_new(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
|
static void
|
||||||
|
@ -949,6 +951,11 @@ cleanup(struct bar *_bar)
|
||||||
struct private *bar = _bar->private;
|
struct private *bar = _bar->private;
|
||||||
struct wayland_backend *backend = bar->backend.data;
|
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) {
|
tll_foreach(backend->buffers, it) {
|
||||||
if (it->item.wl_buf != NULL)
|
if (it->item.wl_buf != NULL)
|
||||||
wl_buffer_destroy(it->item.wl_buf);
|
wl_buffer_destroy(it->item.wl_buf);
|
||||||
|
|
Loading…
Add table
Reference in a new issue