winewayland.drv: Ensure Wayland surface handlers don't access invalid data.
In our setup with a dedicated event dispatch thread, libwayland ensures
that object proxies associated with an event handler remain valid (or
NULL) while the handler is executing. However, no such guarantees are
given for the proxy user data. It is thus possible for the user data to
become invalid (e.g., its memory freed from a different thread) right
after the event handler is entered.
This is an issue for wayland_surface associated proxies since they may
receive unsolicited events from the compositor at any time (e.g.,
xdg_surface.configure), even while we are destroying the
wayland_surface.
To avoid the problem, we introduce a lock that protects access
to xdg_surface user data and ensures that the associated wayland_surface
remains valid for the duration of the handler.
Co-authored-by: Rémi Bernon <rbernon@codeweavers.com>
Showing
Please
register
or
sign in
to comment