Reviewed by Darin.
authorharrison <harrison@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 17 Dec 2004 21:58:19 +0000 (21:58 +0000)
committerharrison <harrison@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 17 Dec 2004 21:58:19 +0000 (21:58 +0000)
Add KWQCFAutorelease for autoreleasing CF objects.
        * kwq/KWQFoundationExtras.h:
        (KWQCFAutorelease):
        New.

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

WebCore/ChangeLog-2005-08-23
WebCore/kwq/KWQFoundationExtras.h

index dc5b7df7dc1a7db3ab13751c2bf985ebce05c801..8328e15ad64a43d4a15a24cdc2be2d5483f59d28 100644 (file)
@@ -1,3 +1,12 @@
+2004-12-17  David Harrison  <harrison@apple.com>
+
+        Reviewed by Darin.
+
+               Add KWQCFAutorelease for autoreleasing CF objects.
+        * kwq/KWQFoundationExtras.h:
+        (KWQCFAutorelease):
+        New.
+
 2004-12-17  David Harrison  <harrison@apple.com>
 
         Reviewed by Darin.
index 2f255326e805c65cd773bf923875de665e202881..edad9941ecf9d342665ca99cc48aa562bcd1cf7f 100644 (file)
@@ -60,6 +60,15 @@ static inline id KWQRetainNSRelease(id obj)
     return obj;
 }
 
+// CF objects need to be "made collectable" for autorelease to work
+// properly in GC
+static inline id KWQCFAutorelease(CFTypeRef obj)
+{
+    CFMakeCollectable(obj);
+    [(id) obj autorelease];
+    return (id) obj;
+}
+
 // Definitions for GC-specific methods for Panther.
 // The finalize method simply won't be called.