[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.
This commit is contained in:
parent
9744625253
commit
02cebe93a6
1 changed files with 7 additions and 0 deletions
|
@ -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()
|
||||
|
|
Loading…
Reference in a new issue