mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-11-06 13:29:45 -05:00
backend/session: fix crash on udev device remove event
libwayland adds phantom listeners here:d81525a235/src/wayland-server.c (L2378)Closes: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3982 (cherry picked from commit406aa5f7f5)
This commit is contained in:
parent
0d20e46498
commit
761927bbbd
1 changed files with 4 additions and 1 deletions
|
|
@ -367,7 +367,10 @@ void wlr_session_close_file(struct wlr_session *session,
|
||||||
}
|
}
|
||||||
|
|
||||||
assert(wl_list_empty(&dev->events.change.listener_list));
|
assert(wl_list_empty(&dev->events.change.listener_list));
|
||||||
assert(wl_list_empty(&dev->events.remove.listener_list));
|
// TODO: assert that the "remove" listener list is empty as well. Listeners
|
||||||
|
// will typically call wlr_session_close_file() in response, and
|
||||||
|
// wl_signal_emit_mutable() installs two phantom listeners, so we'd count
|
||||||
|
// these two.
|
||||||
|
|
||||||
close(dev->fd);
|
close(dev->fd);
|
||||||
wl_list_remove(&dev->link);
|
wl_list_remove(&dev->link);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue