mirror of
https://gitlab.freedesktop.org/wayland/wayland.git
synced 2025-10-31 22:25:25 -04:00
client: Consume file descriptors destined for zombie proxies
We need to close file descriptors sent to zombie proxies to avoid leaking them, and perhaps more importantly, to prevent them from being dispatched in events on other objects (since they would previously be left in the buffer and potentially fed to following events destined for live proxies) Signed-off-by: Derek Foreman <derekf@osg.samsung.com> Reviewed-by: Daniel Stone <daniels@collabora.com>
This commit is contained in:
parent
4485ed1f59
commit
239ba39331
3 changed files with 17 additions and 0 deletions
|
|
@ -1353,8 +1353,16 @@ queue_event(struct wl_display *display, int len)
|
|||
if (len < size)
|
||||
return 0;
|
||||
|
||||
/* If our proxy is gone or a zombie, just eat the event (and any FDs,
|
||||
* if applicable). */
|
||||
proxy = wl_map_lookup(&display->objects, id);
|
||||
if (!proxy || wl_object_is_zombie(&display->objects, id)) {
|
||||
struct wl_zombie *zombie = wl_map_lookup(&display->objects, id);
|
||||
|
||||
if (zombie)
|
||||
wl_connection_close_fds_in(display->connection,
|
||||
zombie->fd_count[opcode]);
|
||||
|
||||
wl_connection_consume(display->connection, size);
|
||||
return size;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue