diff options
author | Herbert Dürr <hdu@apache.org> | 2012-06-15 08:30:03 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-03-07 13:13:24 +0000 |
commit | 736a63b25f5744b245edc31061b4105a5e8465e0 (patch) | |
tree | e8ea966076557577a5f7947a507f2812d8c3d2c7 | |
parent | 2c85769d94a8caaa62be83ce6c94ad31b57f8723 (diff) |
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
-rw-r--r-- | vcl/win/source/gdi/salgdi3.cxx | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/vcl/win/source/gdi/salgdi3.cxx b/vcl/win/source/gdi/salgdi3.cxx index a410028ac3d2..3df9f648e8a2 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; } // ======================================================================= |