mirror of
https://gitlab.freedesktop.org/wayland/wayland.git
synced 2026-03-16 05:34:32 -04:00
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>
This commit is contained in:
parent
cba2754230
commit
cd4e6a1451
1 changed files with 12 additions and 3 deletions
|
|
@ -499,7 +499,10 @@ proxy_create(struct wl_proxy *factory, const struct wl_interface *interface,
|
||||||
return NULL;
|
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;
|
return proxy;
|
||||||
}
|
}
|
||||||
|
|
@ -560,7 +563,10 @@ wl_proxy_create_for_id(struct wl_proxy *factory,
|
||||||
return NULL;
|
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;
|
return proxy;
|
||||||
}
|
}
|
||||||
|
|
@ -2801,7 +2807,10 @@ wl_proxy_create_wrapper(void *proxy)
|
||||||
wrapper->flags = WL_PROXY_FLAG_WRAPPER;
|
wrapper->flags = WL_PROXY_FLAG_WRAPPER;
|
||||||
wrapper->refcount = 1;
|
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);
|
pthread_mutex_unlock(&wrapped_proxy->display->mutex);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue