[Libreoffice-commits] core.git: vcl/qt5

Michael Weghorn (via logerrit) logerrit at kemper.freedesktop.org
Wed Aug 21 15:42:01 UTC 2019


 vcl/qt5/Qt5SvpGraphics.cxx |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 89dd08d15fbe57e3fbeac9a7a9906efd42788c74
Author:     Michael Weghorn <m.weghorn at posteo.de>
AuthorDate: Wed Aug 21 16:06:22 2019 +0200
Commit:     Michael Weghorn <m.weghorn at posteo.de>
CommitDate: Wed Aug 21 17:40:47 2019 +0200

    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 at posteo.de>

diff --git a/vcl/qt5/Qt5SvpGraphics.cxx b/vcl/qt5/Qt5SvpGraphics.cxx
index 4edf55d55644..fc58bbcfcc15 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)


More information about the Libreoffice-commits mailing list