<rdar://problem/6450530> WebCore::FontPlatformData should not leak
authoroliver@apple.com <oliver@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 2 Jan 2009 07:49:37 +0000 (07:49 +0000)
committeroliver@apple.com <oliver@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 2 Jan 2009 07:49:37 +0000 (07:49 +0000)
Reviewed by Dan Bernstein.

Whoops, previous patch should also have fixed the font referencing in
the constructor.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@39545 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog
WebCore/platform/graphics/mac/FontPlatformDataMac.mm

index 4aff684..cc24465 100644 (file)
@@ -4,6 +4,19 @@
 
         <rdar://problem/6450530> WebCore::FontPlatformData should not leak
 
+        Whoops, previous patch should also have fixed the font referencing in
+        the constructor.
+
+        * WebCore.xcodeproj/project.pbxproj:
+        * platform/graphics/mac/FontPlatformDataMac.mm:
+        (WebCore::FontPlatformData::FontPlatformData):
+
+2009-01-01  Oliver Hunt  <oliver@apple.com>
+
+        Reviewed by Dan Bernstein.
+
+        <rdar://problem/6450530> WebCore::FontPlatformData should not leak
+
         Make sure we only adopt the new font, rather than re-referencing (and so leaking).
 
         * platform/graphics/mac/FontPlatformDataMac.mm:
index 30b9103..7cd9ab6 100644 (file)
@@ -34,7 +34,7 @@ FontPlatformData::FontPlatformData(NSFont *f, bool b , bool o)
         CFRetain(f);
     m_size = f ? [f pointSize] : 0.0f;
 #ifndef BUILDING_ON_TIGER
-    m_cgFont = CTFontCopyGraphicsFont(toCTFontRef(f), 0);
+    m_cgFont.adoptCF(CTFontCopyGraphicsFont(toCTFontRef(f), 0));
     m_atsuFontID = CTFontGetPlatformFont(toCTFontRef(f), 0);
 #else
     m_cgFont = wkGetCGFontFromNSFont(f);