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 ); |