summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@digia.com>2013-08-19 12:57:44 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-08-19 14:07:32 +0200
commit6a7a08a28de63ee3a8077474c617b7e4d85edff3 (patch)
tree09ec058e4af619fdf1d528cdb51b2db88a19d952
parent44f742938e2224a842ce3de68c4a2e508d0f17f8 (diff)
downloadqtwebkit-6a7a08a28de63ee3a8077474c617b7e4d85edff3.tar.gz
[Qt] memory leak in WebCore::FontCache::getLastResortFallbackFont
https://bugs.webkit.org/show_bug.cgi?id=118532 Reviewed by Jocelyn Turcotte. We don't need to allocate FontPlatformData on the heap since getCachedFontData makes a deep copy anyway. * platform/graphics/qt/FontCacheQt.cpp: (WebCore::FontCache::getLastResortFallbackFont): Change-Id: I02e974e53f36dd01a4b43a21cc98651913c0d515 git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154103 268f45cc-cd09-0410-ab3c-d52691b4dbfc Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
-rw-r--r--Source/WebCore/platform/graphics/qt/FontCacheQt.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/Source/WebCore/platform/graphics/qt/FontCacheQt.cpp b/Source/WebCore/platform/graphics/qt/FontCacheQt.cpp
index 6d1ee72f2..55a0f821d 100644
--- a/Source/WebCore/platform/graphics/qt/FontCacheQt.cpp
+++ b/Source/WebCore/platform/graphics/qt/FontCacheQt.cpp
@@ -81,7 +81,8 @@ PassRefPtr<SimpleFontData> FontCache::getSimilarFontPlatformData(const Font& fon
PassRefPtr<SimpleFontData> FontCache::getLastResortFallbackFont(const FontDescription& fontDescription, ShouldRetain shouldRetain)
{
const AtomicString fallbackFamily = QFont(fontDescription.family().family()).lastResortFamily();
- return getCachedFontData(new FontPlatformData(fontDescription, fallbackFamily), shouldRetain);
+ FontPlatformData platformData(fontDescription, fallbackFamily);
+ return getCachedFontData(&platformData, shouldRetain);
}
void FontCache::getTraitsInFamily(const AtomicString&, Vector<unsigned>&)