aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAlexandros Frantzis <alexandros.frantzis@collabora.com>2022-11-15 10:50:53 +0200
committerSimon Ser <contact@emersion.fr>2023-02-28 11:22:04 +0000
commit0ba650202e742b23150054cf0740168cd529b010 (patch)
tree70934011a6f3912b9a16de0d9393c236ddb03313 /src
parenttests: Capture the test client log (diff)
downloadwayland-0ba650202e742b23150054cf0740168cd529b010.tar
wayland-0ba650202e742b23150054cf0740168cd529b010.tar.gz
wayland-0ba650202e742b23150054cf0740168cd529b010.tar.bz2
wayland-0ba650202e742b23150054cf0740168cd529b010.tar.lz
wayland-0ba650202e742b23150054cf0740168cd529b010.tar.xz
wayland-0ba650202e742b23150054cf0740168cd529b010.tar.zst
wayland-0ba650202e742b23150054cf0740168cd529b010.zip
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>
Diffstat (limited to 'src')
-rw-r--r--src/wayland-client.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/wayland-client.c b/src/wayland-client.c
index d3d7a7c..f7d7e68 100644
--- a/src/wayland-client.c
+++ b/src/wayland-client.c
@@ -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);