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: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1870>
This commit is contained in:
Carlos Garnacho 2021-05-18 17:57:56 +02:00 committed by Marge Bot
parent f954ff84b8
commit 4ed05830e2

View File

@ -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);
}