From d58246961e4ae962fd9288a57eda4cf8d14d9978 Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Wed, 15 Sep 2021 16:13:08 +0300 Subject: [PATCH] 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. --- src/surfaceitem.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/surfaceitem.cpp b/src/surfaceitem.cpp index 08fe342fab..e14074da21 100644 --- a/src/surfaceitem.cpp +++ b/src/surfaceitem.cpp @@ -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(); }