From 01adb998ffad1385e2d297d3fdb2f3808177fded Mon Sep 17 00:00:00 2001 From: Paul Olav Tvete Date: Fri, 9 Sep 2011 09:46:28 +0200 Subject: [PATCH] Make sure we always release buffers If for some reason the compositor is not able to handle a buffer before the next one arrives, the buffer would be locked forever. This change detects that case, and adds an "emergency release", and displays a warning. --- src/qt-compositor/wayland_wrapper/wlsurface.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/qt-compositor/wayland_wrapper/wlsurface.cpp b/src/qt-compositor/wayland_wrapper/wlsurface.cpp index 258532d..6621882 100644 --- a/src/qt-compositor/wayland_wrapper/wlsurface.cpp +++ b/src/qt-compositor/wayland_wrapper/wlsurface.cpp @@ -99,6 +99,10 @@ public: void attach(struct wl_buffer *buffer) { bool emitMap = !surfaceBuffer; + if (surfaceBuffer && ! textureCreatedForBuffer) { + qWarning() << "### WaylandSurface::attach() releasing undisplayed buffer ###"; + wl_client_post_event(client,&surfaceBuffer->resource.object,WL_BUFFER_RELEASE); + } surfaceBuffer = buffer; surfaceType = WaylandSurface::Invalid; textureCreatedForBuffer = false; -- 2.7.4