diff options
| author | Simon Ser <contact@emersion.fr> | 2021-02-25 23:49:00 +0100 |
|---|---|---|
| committer | Simon Ser <contact@emersion.fr> | 2021-02-25 23:49:00 +0100 |
| commit | 727c7903b27870bed0063814dd594466f21bf6eb (patch) | |
| tree | cd3899f37cd076a34d8cbb4f6cff2b6d42b34000 /src | |
| parent | server: remove duplicate include (diff) | |
| download | wayland-727c7903b27870bed0063814dd594466f21bf6eb.tar wayland-727c7903b27870bed0063814dd594466f21bf6eb.tar.gz wayland-727c7903b27870bed0063814dd594466f21bf6eb.tar.bz2 wayland-727c7903b27870bed0063814dd594466f21bf6eb.tar.lz wayland-727c7903b27870bed0063814dd594466f21bf6eb.tar.xz wayland-727c7903b27870bed0063814dd594466f21bf6eb.tar.zst wayland-727c7903b27870bed0063814dd594466f21bf6eb.zip | |
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>
Diffstat (limited to 'src')
| -rw-r--r-- | src/wayland-client.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/wayland-client.c b/src/wayland-client.c index 21d4606..58531eb 100644 --- a/src/wayland-client.c +++ b/src/wayland-client.c @@ -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 |
