webengine/osswebengine/WebCore/platform/FontCache.cpp
changeset 10 a359256acfc6
parent 5 10e98eab6f85
child 48 79859ed3eea9
equal deleted inserted replaced
5:10e98eab6f85 10:a359256acfc6
   102 typedef HashMap<FontPlatformDataCacheKey, FontPlatformData*, FontPlatformDataCacheKeyHash, FontPlatformDataCacheKeyTraits> FontPlatformDataCache;
   102 typedef HashMap<FontPlatformDataCacheKey, FontPlatformData*, FontPlatformDataCacheKeyHash, FontPlatformDataCacheKeyTraits> FontPlatformDataCache;
   103 typedef HashMap<FontPlatformDataCacheKey, FontPlatformData*, FontPlatformDataCacheKeyHash, FontPlatformDataCacheKeyTraits>::iterator FontPlatformDataCacheIterator;
   103 typedef HashMap<FontPlatformDataCacheKey, FontPlatformData*, FontPlatformDataCacheKeyHash, FontPlatformDataCacheKeyTraits>::iterator FontPlatformDataCacheIterator;
   104 
   104 
   105 static FontPlatformDataCache* gFontPlatformDataCache = 0;
   105 static FontPlatformDataCache* gFontPlatformDataCache = 0;
   106 
   106 
   107 struct cleanupFontDataCache {
   107 void cleanupFontDataCache() 
   108     ~cleanupFontDataCache() {
   108 {
   109         if( gFontPlatformDataCache ) 
   109     if( gFontPlatformDataCache ) 
   110         {
   110     {
   111 			FontPlatformDataCacheIterator end = gFontPlatformDataCache->end();
   111 		FontPlatformDataCacheIterator end = gFontPlatformDataCache->end();
   112 			for (FontPlatformDataCacheIterator it = gFontPlatformDataCache->begin(); it != end; ++it) 
   112 		for (FontPlatformDataCacheIterator it = gFontPlatformDataCache->begin(); it != end; ++it) 
   113 				{
   113 			{
   114 				FontPlatformData* obj = (*it).second;
   114 			FontPlatformData* obj = (*it).second;
   115 				delete obj;
   115 			delete obj;
   116 				}
   116 			}
   117           gFontPlatformDataCache->clear();
   117       gFontPlatformDataCache->clear();
   118           delete gFontPlatformDataCache;
   118       delete gFontPlatformDataCache;
   119           gFontPlatformDataCache=0;
   119       gFontPlatformDataCache=0;
   120         }
   120     }
   121     }
   121 }
   122 };
       
   123 static cleanupFontDataCache cleanFontDataCache;
       
   124 
   122 
   125 static const AtomicString& alternateFamilyName(const AtomicString& familyName)
   123 static const AtomicString& alternateFamilyName(const AtomicString& familyName)
   126 {
   124 {
   127 #if PLATFORM(SYMBIAN)
   125 #if PLATFORM(SYMBIAN)
   128     return FontCache::systemFontFamilyName( familyName );
   126     return FontCache::systemFontFamilyName( familyName );