[wayland] Unreference the buffer when destroying the WindowPixmap

When we don't use the buffer anymore, we should discard it. Otherwise
we start to leak buffers and that can result in clients dead locking
while waiting for more free buffers.
icc-effect-5.14.5
Martin Gräßlin 2015-06-12 16:22:41 +02:00
parent 9744625253
commit 02cebe93a6
1 changed files with 7 additions and 0 deletions

View File

@ -937,6 +937,13 @@ WindowPixmap::~WindowPixmap()
if (isValid() && !kwinApp()->shouldUseWaylandForCompositing()) {
xcb_free_pixmap(connection(), m_pixmap);
}
#if HAVE_WAYLAND
if (m_buffer) {
using namespace KWayland::Server;
QObject::disconnect(m_buffer.data(), &BufferInterface::aboutToBeDestroyed, m_buffer.data(), &BufferInterface::unref);
m_buffer->unref();
}
#endif
}
void WindowPixmap::create()