scene: Fix previous pixmap ref'ing

discardPixmap() increases the reference counter, but there's no matching
place where the ref count is decreased, which results in the previous
pixmap not being released even if it's not needed anymore.
This commit is contained in:
Vlad Zahorodnii 2021-09-15 16:13:08 +03:00
parent 46a69357a7
commit d58246961e

View file

@ -110,7 +110,7 @@ void SurfaceItem::updatePixmap()
} else {
m_pixmap->create();
if (m_pixmap->isValid()) {
m_previousPixmap.reset();
unreferencePreviousPixmap();
discardQuads();
}
}
@ -122,7 +122,7 @@ void SurfaceItem::discardPixmap()
if (m_pixmap->isValid()) {
m_previousPixmap.reset(m_pixmap.take());
m_previousPixmap->markAsDiscarded();
m_referencePixmapCounter++;
referencePreviousPixmap();
} else {
m_pixmap.reset();
}