From cdd18cd3938141229f33cbd62e4b2d3356c1049a Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Sat, 4 Mar 2023 12:04:27 +0200 Subject: [PATCH] effects/slidingpopups: Prevent potential use-after-free --- src/effects/slidingpopups/slidingpopups.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/effects/slidingpopups/slidingpopups.cpp b/src/effects/slidingpopups/slidingpopups.cpp index 5cc69f76a0..e8ae547fc8 100644 --- a/src/effects/slidingpopups/slidingpopups.cpp +++ b/src/effects/slidingpopups/slidingpopups.cpp @@ -186,6 +186,7 @@ void SlidingPopupsEffect::postPaintWindow(EffectWindow *w) { auto animationIt = m_animations.find(w); if (animationIt != m_animations.end()) { + effects->addRepaint(w->expandedGeometry()); if ((*animationIt).timeLine.done()) { if (!w->isDeleted()) { w->setData(WindowForceBackgroundContrastRole, QVariant()); @@ -193,7 +194,6 @@ void SlidingPopupsEffect::postPaintWindow(EffectWindow *w) } m_animations.erase(animationIt); } - effects->addRepaint(w->expandedGeometry()); } effects->postPaintWindow(w);