X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Finternal%2Ftext%2Ftext-abstraction%2Ffont-client-plugin-impl.cpp;h=f7fc5cbb026d943b78566e2a23f0e094ba539811;hb=3c558a47e427220cd9f88cd94af5fcdc0d12d4fa;hp=65ca24ea776d1a2157c0aadba89ab321a67b24b8;hpb=70669ad4aea1936c2d3f6a654398d6592f9175af;p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git diff --git a/dali/internal/text/text-abstraction/font-client-plugin-impl.cpp b/dali/internal/text/text-abstraction/font-client-plugin-impl.cpp index 65ca24e..f7fc5cb 100644 --- a/dali/internal/text/text-abstraction/font-client-plugin-impl.cpp +++ b/dali/internal/text/text-abstraction/font-client-plugin-impl.cpp @@ -252,7 +252,7 @@ FontClient::Plugin::~Plugin() #ifdef ENABLE_VECTOR_BASED_TEXT_RENDERING delete mVectorFontCache; #endif - + DestroyMatchedPatterns(); FT_Done_FreeType( mFreeTypeLibrary ); } @@ -1961,9 +1961,9 @@ void FontClient::Plugin::CacheFontPath( FT_Face ftFace, FontId id, PointSize26Do FcCharSet* characterSet = NULL; FcPatternGetCharSet( match, FC_CHARSET, 0u, &characterSet ); - FcPatternDestroy( match ); FcPatternDestroy( pattern ); + mMatchedFcPatternCache.PushBack( match ); mFontCache[id-1u].mCharacterSet = characterSet; // Add the path to the cache. @@ -1983,7 +1983,7 @@ void FontClient::Plugin::CacheFontPath( FT_Face ftFace, FontId id, PointSize26Do } } -FcCharSet* FontClient::Plugin::CreateCharacterSetFromDescription( const FontDescription& description ) const +FcCharSet* FontClient::Plugin::CreateCharacterSetFromDescription( const FontDescription& description ) { FcCharSet* characterSet = NULL; @@ -1995,14 +1995,22 @@ FcCharSet* FontClient::Plugin::CreateCharacterSetFromDescription( const FontDesc FcPattern* match = FcFontMatch( NULL, pattern, &result ); FcPatternGetCharSet( match, FC_CHARSET, 0u, &characterSet ); + mMatchedFcPatternCache.PushBack( match ); - FcPatternDestroy( match ); FcPatternDestroy( pattern ); } return characterSet; } +void FontClient::Plugin::DestroyMatchedPatterns() +{ + for (auto & object : mMatchedFcPatternCache) { + FcPatternDestroy(reinterpret_cast(object)); + } + mMatchedFcPatternCache.Clear(); +} + } // namespace Internal } // namespace TextAbstraction