Qt5SvpGraphics::handleDamage: Don't leak BitmapBuffer
Leak found by valgrind.
Change-Id: If2d03e94467210bc0e485e6a81bf8480a958323d
Reviewed-on: https://gerrit.libreoffice.org/77889
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
diff --git a/vcl/qt5/Qt5SvpGraphics.cxx b/vcl/qt5/Qt5SvpGraphics.cxx
index 4edf55d..fc58bbc 100644
--- a/vcl/qt5/Qt5SvpGraphics.cxx
+++ b/vcl/qt5/Qt5SvpGraphics.cxx
@@ -81,12 +81,12 @@ void Qt5SvpGraphics::handleDamage(const tools::Rectangle& rDamagedRegion)
QImage* pImage = static_cast<Qt5Graphics_Controls*>(m_pWidgetDraw.get())->getImage();
assert(pImage);
BitmapBuffer* pBuffer = new BitmapBuffer;
QImage2BitmapBuffer(*pImage, *pBuffer);
BitmapBuffer aBuffer;
QImage2BitmapBuffer(*pImage, aBuffer);
SalTwoRect aTR(0, 0, pImage->width(), pImage->height(), rDamagedRegion.getX(),
rDamagedRegion.getY(), rDamagedRegion.GetWidth(), rDamagedRegion.GetHeight());
drawBitmap(aTR, pBuffer, CAIRO_OPERATOR_OVER);
drawBitmap(aTR, &aBuffer, CAIRO_OPERATOR_OVER);
}
void Qt5SvpGraphics::GetResolution(sal_Int32& rDPIX, sal_Int32& rDPIY)