incubator-ooo-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject [Bug 119997] New: There is a memory leak in function WinGlyphFallbackSubstititution::FindFontSubstitute
Date Fri, 15 Jun 2012 05:06:18 GMT
https://issues.apache.org/ooo/show_bug.cgi?id=119997

          Priority: P3
            Bug ID: 119997
                CC: ooo-issues@incubator.apache.org
          Assignee: issues@performance.openoffice.org
           Summary: There is a memory leak in function
                    WinGlyphFallbackSubstititution::FindFontSubstitute
          Severity: normal
        Issue Type: DEFECT
    Classification: Code
                OS: All
          Reporter: chao.dev.h@gmail.com
          Hardware: PC
            Status: UNCONFIRMED
           Version: AOO 3.4.0
         Component: www
           Product: performance

(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

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Mime
View raw message