mirror of
https://gitlab.freedesktop.org/wayland/wayland.git
synced 2025-10-29 05:40:16 -04:00
client: assert queue display matches proxy
In wl_proxy_set_queue, passing a wl_event_queue from a completely unrelated wl_display could lead to object IDs mismatches. Add an assertion to catch this case. It's always a user bug if this happens. Signed-off-by: Simon Ser <contact@emersion.fr>
This commit is contained in:
parent
70f1c83fd9
commit
727c7903b2
1 changed files with 4 additions and 2 deletions
|
|
@ -2177,10 +2177,12 @@ wl_proxy_get_class(struct wl_proxy *proxy)
|
|||
WL_EXPORT void
|
||||
wl_proxy_set_queue(struct wl_proxy *proxy, struct wl_event_queue *queue)
|
||||
{
|
||||
if (queue)
|
||||
if (queue) {
|
||||
assert(proxy->display == queue->display);
|
||||
proxy->queue = queue;
|
||||
else
|
||||
} else {
|
||||
proxy->queue = &proxy->display->default_queue;
|
||||
}
|
||||
}
|
||||
|
||||
/** Create a proxy wrapper for making queue assignments thread-safe
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue