[Libreoffice-commits] core.git: Branch 'libreoffice-5-4' - vcl/headless

Caolán McNamara caolanm at redhat.com
Mon Aug 28 10:11:32 UTC 2017


 vcl/headless/svpgdi.cxx |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

New commits:
commit 3210d265415bd61a318d619e5098028384c469da
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Aug 28 08:53:11 2017 +0100

    ofz#3092 Direct-leak
    
    Change-Id: Ib10bd9bd2e6e712cb0a9c1906600543f786d7f53
    Reviewed-on: https://gerrit.libreoffice.org/41619
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Michael Stahl <mstahl at redhat.com>

diff --git a/vcl/headless/svpgdi.cxx b/vcl/headless/svpgdi.cxx
index 033389e53aeb..52326084126b 100644
--- a/vcl/headless/svpgdi.cxx
+++ b/vcl/headless/svpgdi.cxx
@@ -1328,9 +1328,16 @@ cairo_user_data_key_t* SvpSalGraphics::getDamageKey()
 
 void SvpSalGraphics::releaseCairoContext(cairo_t* cr, bool bXorModeAllowed, const basegfx::B2DRange& rExtents) const
 {
+    const bool bXoring = (m_ePaintMode == PaintMode::Xor && bXorModeAllowed);
+
     if (rExtents.isEmpty())
     {
         //nothing changed, return early
+        if (bXoring)
+        {
+            cairo_surface_t* surface = cairo_get_target(cr);
+            cairo_surface_destroy(surface);
+        }
         cairo_destroy(cr);
         return;
     }
@@ -1350,7 +1357,7 @@ void SvpSalGraphics::releaseCairoContext(cairo_t* cr, bool bXorModeAllowed, cons
     //For the most part we avoid the use of XOR these days, but there
     //are some edge cases where legacy stuff still supports it, so
     //emulate it (slowly) here.
-    if (m_ePaintMode == PaintMode::Xor && bXorModeAllowed)
+    if (bXoring)
     {
         cairo_surface_t* target_surface = m_pSurface;
         if (cairo_surface_get_type(target_surface) != CAIRO_SURFACE_TYPE_IMAGE)


More information about the Libreoffice-commits mailing list