diff options
| author | Loïc Yhuel <loic.yhuel@softathome.com> | 2025-09-16 13:15:34 +0200 |
|---|---|---|
| committer | Simon Ser <contact@emersion.fr> | 2026-03-01 01:03:37 +0000 |
| commit | cd4e6a14517c71285acc976fe10b12e490d72a59 (patch) | |
| tree | 06d802db0486d2e0e639d3249da32f2a5fb80973 /src | |
| parent | protocol: add wl_data_device_manager destructors (diff) | |
| download | wayland-cd4e6a14517c71285acc976fe10b12e490d72a59.tar wayland-cd4e6a14517c71285acc976fe10b12e490d72a59.tar.gz wayland-cd4e6a14517c71285acc976fe10b12e490d72a59.tar.bz2 wayland-cd4e6a14517c71285acc976fe10b12e490d72a59.tar.lz wayland-cd4e6a14517c71285acc976fe10b12e490d72a59.tar.xz wayland-cd4e6a14517c71285acc976fe10b12e490d72a59.tar.zst wayland-cd4e6a14517c71285acc976fe10b12e490d72a59.zip | |
client: fix crash when creating proxies with no queue
Before, it worked if the client did set a queue on the proxy before any event was received.
Now we have the "warning: queue xxx destroyed while proxies still attached", then a crash if one of
the proxies is used to create a proxy.
Fixes: 674145dc3f ("client: Track the proxies attached to a queue")
Fixes: 0ba650202e ("client: Warn when a queue is destroyed with attached proxies")
Signed-off-by: Loïc Yhuel <loic.yhuel@softathome.com>
Diffstat (limited to 'src')
| -rw-r--r-- | src/wayland-client.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/wayland-client.c b/src/wayland-client.c index ed686b5..50b3b4b 100644 --- a/src/wayland-client.c +++ b/src/wayland-client.c @@ -499,7 +499,10 @@ proxy_create(struct wl_proxy *factory, const struct wl_interface *interface, return NULL; } - wl_list_insert(&proxy->queue->proxy_list, &proxy->queue_link); + if (proxy->queue != NULL) + wl_list_insert(&proxy->queue->proxy_list, &proxy->queue_link); + else + wl_list_init(&proxy->queue_link); return proxy; } @@ -560,7 +563,10 @@ wl_proxy_create_for_id(struct wl_proxy *factory, return NULL; } - wl_list_insert(&proxy->queue->proxy_list, &proxy->queue_link); + if (proxy->queue != NULL) + wl_list_insert(&proxy->queue->proxy_list, &proxy->queue_link); + else + wl_list_init(&proxy->queue_link); return proxy; } @@ -2801,7 +2807,10 @@ wl_proxy_create_wrapper(void *proxy) wrapper->flags = WL_PROXY_FLAG_WRAPPER; wrapper->refcount = 1; - wl_list_insert(&wrapper->queue->proxy_list, &wrapper->queue_link); + if (wrapper->queue != NULL) + wl_list_insert(&wrapper->queue->proxy_list, &wrapper->queue_link); + else + wl_list_init(&wrapper->queue_link); pthread_mutex_unlock(&wrapped_proxy->display->mutex); |
