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:
Simon Ser 2021-02-25 23:49:00 +01:00
parent 70f1c83fd9
commit 727c7903b2

View file

@ -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