mirror of
https://gitlab.freedesktop.org/wayland/wayland.git
synced 2025-10-31 22:25:25 -04:00
client: Warn when a queue is destroyed with attached proxies
Log a warning if the queue is destroyed while proxies are still attached, to help developers debug and fix potential memory errors. Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
This commit is contained in:
parent
d4d3228853
commit
0ba650202e
2 changed files with 109 additions and 0 deletions
|
|
@ -301,6 +301,22 @@ wl_event_queue_release(struct wl_event_queue *queue)
|
|||
{
|
||||
struct wl_closure *closure;
|
||||
|
||||
if (!wl_list_empty(&queue->proxy_list)) {
|
||||
struct wl_proxy *proxy, *tmp;
|
||||
|
||||
wl_log("warning: queue %p destroyed while proxies still "
|
||||
"attached:\n", queue);
|
||||
|
||||
wl_list_for_each_safe(proxy, tmp, &queue->proxy_list,
|
||||
queue_link) {
|
||||
wl_log(" %s@%u still attached\n",
|
||||
proxy->object.interface->name,
|
||||
proxy->object.id);
|
||||
wl_list_remove(&proxy->queue_link);
|
||||
wl_list_init(&proxy->queue_link);
|
||||
}
|
||||
}
|
||||
|
||||
while (!wl_list_empty(&queue->event_list)) {
|
||||
closure = wl_container_of(queue->event_list.next,
|
||||
closure, link);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue