[Libreoffice-commits] core.git: Branch 'libreoffice-7-1' - vcl/headless

Noel Grandin (via logerrit) logerrit at kemper.freedesktop.org
Fri Apr 9 17:44:31 UTC 2021


 vcl/headless/svpgdi.cxx |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

New commits:
commit f86c1b481cedcfc055be99cf24e4e01452fc964f
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Fri Apr 9 13:58:28 2021 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Fri Apr 9 19:43:52 2021 +0200

    fix small cairo leak in gen backend
    
    Change-Id: I57b8cd00d252cef2699d499b9080f829be9098da
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113854
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/vcl/headless/svpgdi.cxx b/vcl/headless/svpgdi.cxx
index 40e2ad1542b1..0b62ccf467c1 100644
--- a/vcl/headless/svpgdi.cxx
+++ b/vcl/headless/svpgdi.cxx
@@ -1982,6 +1982,7 @@ bool SvpSalGraphics::drawGradient(const tools::PolyPolygon& rPolyPolygon, const
         1.0);
 
     cairo_set_source(cr, pattern);
+    cairo_pattern_destroy(pattern);
 
     basegfx::B2DRange extents = getClippedFillDamage(cr);
     cairo_fill_preserve(cr);
@@ -2001,8 +2002,7 @@ bool SvpSalGraphics::implDrawGradient(basegfx::B2DPolyPolygon const & rPolyPolyg
     for (auto const & rPolygon : rPolyPolygon)
         AddPolygonToPath(cr, rPolygon, rObjectToDevice, !getAntiAlias(), false);
 
-    cairo_pattern_t* pattern;
-    pattern = cairo_pattern_create_linear(rGradient.maPoint1.getX(), rGradient.maPoint1.getY(), rGradient.maPoint2.getX(), rGradient.maPoint2.getY());
+    cairo_pattern_t* pattern = cairo_pattern_create_linear(rGradient.maPoint1.getX(), rGradient.maPoint1.getY(), rGradient.maPoint2.getX(), rGradient.maPoint2.getY());
 
     for (SalGradientStop const & rStop : rGradient.maStops)
     {
@@ -2015,6 +2015,7 @@ bool SvpSalGraphics::implDrawGradient(basegfx::B2DPolyPolygon const & rPolyPolyg
         cairo_pattern_add_color_stop_rgba(pattern, offset, r, g, b, a);
     }
     cairo_set_source(cr, pattern);
+    cairo_pattern_destroy(pattern);
 
     basegfx::B2DRange extents = getClippedFillDamage(cr);
     cairo_fill_preserve(cr);


More information about the Libreoffice-commits mailing list