[wayland] Reference BufferInterface in WindowPixmap
As long as our WindowPixmap uses the buffer we should have it referenced.icc-effect-5.14.5
parent
209b62d522
commit
cfba4bacdf
|
@ -993,8 +993,15 @@ bool WindowPixmap::isValid() const
|
|||
void WindowPixmap::updateBuffer()
|
||||
{
|
||||
if (auto s = toplevel()->surface()) {
|
||||
using namespace KWayland::Server;
|
||||
if (auto b = s->buffer()) {
|
||||
if (m_buffer) {
|
||||
QObject::disconnect(m_buffer.data(), &BufferInterface::aboutToBeDestroyed, m_buffer.data(), &BufferInterface::unref);
|
||||
m_buffer->unref();
|
||||
}
|
||||
m_buffer = b;
|
||||
m_buffer->ref();
|
||||
QObject::connect(m_buffer.data(), &BufferInterface::aboutToBeDestroyed, m_buffer.data(), &BufferInterface::unref);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue