summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/state_trackers')
-rw-r--r--src/gallium/state_trackers/egl/wayland/native_wayland.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/gallium/state_trackers/egl/wayland/native_wayland.c b/src/gallium/state_trackers/egl/wayland/native_wayland.c
index 560e40d4cee..941a0944518 100644
--- a/src/gallium/state_trackers/egl/wayland/native_wayland.c
+++ b/src/gallium/state_trackers/egl/wayland/native_wayland.c
@@ -57,9 +57,12 @@ wayland_roundtrip(struct wayland_display *display)
callback = wl_display_sync(display->dpy);
wl_callback_add_listener(callback, &sync_listener, &done);
wl_proxy_set_queue((struct wl_proxy *) callback, display->queue);
- while (ret == 0 && !done)
+ while (ret != -1 && !done)
ret = wl_display_dispatch_queue(display->dpy, display->queue);
+ if (!done)
+ wl_callback_destroy(callback);
+
return ret;
}