summaryrefslogtreecommitdiffstats
path: root/webkit/port
diff options
context:
space:
mode:
authordarin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-12-13 00:59:07 +0000
committerdarin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-12-13 00:59:07 +0000
commit558e5603264fe0995eccf998a0aca6dbc49c44d9 (patch)
treee8ef90e9e5b38607ef7d724a54411ea7d7dbf002 /webkit/port
parent99375aebbc21d25c94481caf3896102f2332e989 (diff)
downloadchromium_src-558e5603264fe0995eccf998a0aca6dbc49c44d9.zip
chromium_src-558e5603264fe0995eccf998a0aca6dbc49c44d9.tar.gz
chromium_src-558e5603264fe0995eccf998a0aca6dbc49c44d9.tar.bz2
Fix purify complaint about FontData structs being leaked. These are held in a
cache that never evicts anything, so they are not real leaks. We just used to free them before to probably make purify happy, and I didn't realize that when I made recent changes to the file. Now we clean up the FontData structs again. R=brettw Review URL: http://codereview.chromium.org/14410 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@6961 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/port')
-rw-r--r--webkit/port/platform/graphics/chromium/FontUtilsChromiumWin.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/webkit/port/platform/graphics/chromium/FontUtilsChromiumWin.cpp b/webkit/port/platform/graphics/chromium/FontUtilsChromiumWin.cpp
index 184fb6f..3002b97 100644
--- a/webkit/port/platform/graphics/chromium/FontUtilsChromiumWin.cpp
+++ b/webkit/port/platform/graphics/chromium/FontUtilsChromiumWin.cpp
@@ -120,7 +120,7 @@ struct FontData {
// well-within 1-sigma of each other so that the difference is not significant.
// On the other hand, some pages in intl2 seem to take longer to load with map
// in the 1st pass. Need to experiment further.
-typedef HashMap<String, FontData*> FontDataCache;
+typedef HashMap<String, FontData> FontDataCache;
} // namespace
@@ -277,15 +277,15 @@ bool GetDerivedFontData(const UChar *family,
// a font even if there's no font matching the name. Need to
// check it against what we actually want (as is done in
// FontCacheWin.cpp)
- derived = new FontData;
+ pair<FontDataCache::iterator, bool> entry = fontDataCache.add(fontKey, FontData());
+ derived = &entry.first->second;
derived->hfont = CreateFontIndirect(logfont);
// GetAscent may return kUndefinedAscent, but we still want to
// cache it so that we won't have to call CreateFontIndirect once
// more for HFONT next time.
derived->ascent = GetAscent(derived->hfont);
- fontDataCache.add(fontKey, derived);
} else {
- derived = iter->second;
+ derived = &iter->second;
// Last time, GetAscent failed so that only HFONT was
// cached. Try once more assuming that TryPreloadFont
// was called by a caller between calls.