Apache OpenOffice (AOO) Bugzilla – Issue 119997
[From Symphony] [MemoryLeak]There is a memory leak in function WinGlyphFallbackSubstititution::FindFontSubstitute
Last modified: 2013-02-16 09:20:48 UTC
(1) Code snippet in function WinGlyphFallbackSubstititution::FindFontSubstitute: ------------------------------------------------------------------------------- // last level fallback, check each font type face one by one const 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; for( int i = 0; i < nTestFontCount; ++i ) { const ImplFontData* pFace = pTestFontList->Get( i ); if( !HasMissingChars( pFace, rMissingChars ) ) continue; rFontSelData.maSearchName = pFace->maName; return true; } return false; (2)Memory Leak : -------------------------------------------------------------------------------- The pTestFontList will be created in function ImplDevFontList::GetDevFontList(), which will new an object typed ImplGetDevFontList on heap. The pTestFontList will not be released when return from function WinGlyphFallbackSubstititution::FindFontSubstitute
Steps to reproduce the issue: 1) Launch Aoo3.4 2) New a odt file 3) Close the odt file Defect : There is a memory leak in function WinGlyphFallbackSubstititution::FindFontSubstitute
Need to free pTestFontList explicitly.
Created attachment 78338 [details] for file "main\vcl\win\source\gdi\salgdi3.cxx"
Thanks for the find and for the patch! Applied as rev 1350553 with minor style adaptions to surrounding code. In the future there is potential for more performance gains when GetDevFontList() gets modified to return a read-only reference of the list.
add MemoryLeak tag for this defect. Need long time running to verify.
set release blocker flag for 3.4.1
Also applied ChaoHuang's patch for AOO 3.4.1 as revision 1356233
Since last SVT(r1400866) shows there is no memory leak, so close this defect as resolved.