From 4ed05830e20f4d87a580c8d5073996d97a0975a4 Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Tue, 18 May 2021 17:57:56 +0200 Subject: [PATCH] wayland: Close pipe file descriptors after use Both ends were being leaked here, one directly, other through the GIOChannel. Fixes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/4302 (just maybe) Part-of: --- src/wayland/meta-wayland-data-device.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/wayland/meta-wayland-data-device.c b/src/wayland/meta-wayland-data-device.c index dd9c162e7..2f3c154a1 100644 --- a/src/wayland/meta-wayland-data-device.c +++ b/src/wayland/meta-wayland-data-device.c @@ -425,7 +425,9 @@ meta_wayland_data_source_fake_read (MetaWaylandDataSource *source, } meta_wayland_data_source_send (source, mimetype, p[1]); + close (p[1]); channel = g_io_channel_unix_new (p[0]); + g_io_channel_set_close_on_unref (channel, TRUE); g_io_add_watch (channel, G_IO_HUP, on_fake_read_hup, source); }