Title: [154103] trunk/Source/WebCore
Revision
154103
Author
[email protected]
Date
2013-08-15 09:24:00 -0700 (Thu, 15 Aug 2013)

Log Message

[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):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (154102 => 154103)


--- trunk/Source/WebCore/ChangeLog	2013-08-15 16:14:03 UTC (rev 154102)
+++ trunk/Source/WebCore/ChangeLog	2013-08-15 16:24:00 UTC (rev 154103)
@@ -1,3 +1,16 @@
+2013-08-15  Allan Sandfeld Jensen  <[email protected]>
+
+        [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):
+
 2013-08-15  Rob Buis  <[email protected]>
 
         ASSERTION FAILED: !m_adoptionIsRequired in void WebCore::TreeShared<NodeType>::ref()

Modified: trunk/Source/WebCore/platform/graphics/qt/FontCacheQt.cpp (154102 => 154103)


--- trunk/Source/WebCore/platform/graphics/qt/FontCacheQt.cpp	2013-08-15 16:14:03 UTC (rev 154102)
+++ trunk/Source/WebCore/platform/graphics/qt/FontCacheQt.cpp	2013-08-15 16:24:00 UTC (rev 154103)
@@ -76,7 +76,8 @@
 PassRefPtr<SimpleFontData> FontCache::getLastResortFallbackFont(const FontDescription& fontDescription, ShouldRetain shouldRetain)
 {
     const AtomicString fallbackFamily = QFont(fontDescription.firstFamily()).lastResortFamily();
-    return getCachedFontData(new FontPlatformData(fontDescription, fallbackFamily), shouldRetain);
+    FontPlatformData platformData(fontDescription, fallbackFamily);
+    return getCachedFontData(&platformData, shouldRetain);
 }
 
 void FontCache::getTraitsInFamily(const AtomicString&, Vector<unsigned>&)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to