[Libreoffice-commits] core.git: 2 commits - drawinglayer/source vcl/win

Herbert Dürr hdu at apache.org
Thu Mar 7 05:13:46 PST 2013


 drawinglayer/source/processor3d/zbufferprocessor3d.cxx |    8 ++++----
 vcl/win/source/gdi/salgdi3.cxx                         |   12 ++++++++----
 2 files changed, 12 insertions(+), 8 deletions(-)

New commits:
commit 736a63b25f5744b245edc31061b4105a5e8465e0
Author: Herbert Dürr <hdu at apache.org>
Date:   Fri Jun 15 08:30:03 2012 +0000

    Resolves: #i119997# fix a memory leak by WinGlyphFallbackSubstitution
    
    Patch by: Chao Huang
    Found by: Chao Huang
    Review by: hdu
    
    Conflicts:
    	vcl/win/source/gdi/salgdi3.cxx
    
    Change-Id: I6cde84b54a42fd8951d68280fac9dccd2b2e5c4a

diff --git a/vcl/win/source/gdi/salgdi3.cxx b/vcl/win/source/gdi/salgdi3.cxx
index a410028..3df9f64 100644
--- a/vcl/win/source/gdi/salgdi3.cxx
+++ b/vcl/win/source/gdi/salgdi3.cxx
@@ -589,23 +589,27 @@ bool WinGlyphFallbackSubstititution::FindFontSubstitute( FontSelectPattern& rFon
     }
 
     // last level fallback, check each font type face one by one
-    const ImplGetDevFontList* pTestFontList = pDevFontList->GetDevFontList();
+    ImplGetDevFontList* pTestFontList = pDevFontList->GetDevFontList();
     // limit the count of fonts to be checked to prevent hangs
     static const int MAX_GFBFONT_COUNT = 600;
     int nTestFontCount = pTestFontList->Count();
     if( nTestFontCount > MAX_GFBFONT_COUNT )
         nTestFontCount = MAX_GFBFONT_COUNT;
 
+    bool bFound = false;
     for( int i = 0; i < nTestFontCount; ++i )
     {
         const PhysicalFontFace* pFace = pTestFontList->Get( i );
-        if( !HasMissingChars( pFace, rMissingChars ) )
+        bFound = HasMissingChars( pFace, rMissingChars );
+        if( !bFound )
             continue;
         rFontSelData.maSearchName = pFace->GetFamilyName();
-        return true;
+        break;
     }
 
-    return false;
+    delete pTestFontList;
+
+    return bFound;
 }
 
 // =======================================================================
commit 2c85769d94a8caaa62be83ce6c94ad31b57f8723
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Mar 7 12:54:21 2013 +0000

    make sure Release is called if one of two Acquires failed
    
    checking the body of ReleaseAccess in vcl its safe to pass
    NULL to them, so keep it simple
    
    Change-Id: I5f057f9c79f0787d670869af4114c989e7f1562a

diff --git a/drawinglayer/source/processor3d/zbufferprocessor3d.cxx b/drawinglayer/source/processor3d/zbufferprocessor3d.cxx
index 5bdb354..31c96f8 100644
--- a/drawinglayer/source/processor3d/zbufferprocessor3d.cxx
+++ b/drawinglayer/source/processor3d/zbufferprocessor3d.cxx
@@ -56,7 +56,7 @@ namespace
             BitmapWriteAccess* pContent = aContent.AcquireWriteAccess();
             BitmapWriteAccess* pAlpha = aAlpha.AcquireWriteAccess();
 
-            if(pContent && pAlpha)
+            if (pContent && pAlpha)
             {
                 if(mnAntiAlialize)
                 {
@@ -117,11 +117,11 @@ namespace
                         }
                     }
                 }
-
-                aContent.ReleaseAccess(pContent);
-                aAlpha.ReleaseAccess(pAlpha);
             }
 
+            aAlpha.ReleaseAccess(pAlpha);
+            aContent.ReleaseAccess(pContent);
+
             aRetval = BitmapEx(aContent, aAlpha);
 
             // #i101811# set PrefMapMode and PrefSize at newly created Bitmap


More information about the Libreoffice-commits mailing list