Krita is a free and open source cross-platform application that offers an end-to-end solution for creating digital art files from scratch built on the KDE and Qt frameworks.
C++
Fix memory leak in KisHandlePainterHelper::drawHandleRect
Dmitry Kazakov8305b2bf328e
diff --git a/libs/global/KisHandlePainterHelper.cpp b/libs/global/KisHandlePainterHelper.cppindex 923008e043..ed92de96ea 100644--- a/libs/global/KisHandlePainterHelper.cpp+++ b/libs/global/KisHandlePainterHelper.cpp@@ -87,13 +87,11 @@ void KisHandlePainterHelper::drawHandleRect(const QPointF ¢er, qreal radius,const QPen originalPen = m_painter->pen();// temporarily set the pen width to 2 to avoid pixel shifting dropping pixels the border- QPen *tempPen = new QPen(m_painter->pen());- tempPen->setCosmetic(true);- tempPen->setWidth(4 * m_decorationThickness);- const QPen customPen = *tempPen;+ QPen customPen = m_painter->pen();+ customPen.setCosmetic(true);+ customPen.setWidth(4);m_painter->setPen(customPen);-Q_FOREACH (KisHandleStyle::IterationStyle it, m_handleStyle.handleIterations) {it.stylePair.first.setWidthF(it.stylePair.first.widthF() * m_decorationThickness);PenBrushSaver saver(it.isValid ? m_painter : 0, it.stylePair, PenBrushSaver::allow_noop);