]> git.saurik.com Git - wxWidgets.git/commitdiff
Make wxCFRef take a template raw pointer parameter instead of CFTypeRef to ensure...
authorDavid Elliott <dfe@tgwbd.org>
Sat, 12 May 2007 19:30:09 +0000 (19:30 +0000)
committerDavid Elliott <dfe@tgwbd.org>
Sat, 12 May 2007 19:30:09 +0000 (19:30 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@46000 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/mac/corefoundation/cfref.h

index cabf81e616e6a8f1e5164a957ec372887ba29c14..7506791c0f77eae2faffeb0c78faeb830dc962bf 100644 (file)
 
 /*! @function   wxCFRelease
     @abstract   A CFRelease variant that checks for NULL before releasing.
+    @discussion The parameter is template not for type safety but to ensure the argument
+                is a raw pointer and not a ref holder of any type.
 */
-inline void wxCFRelease(CFTypeRef r)
+template <class Type>
+inline void wxCFRelease(Type *r)
 {
     if ( r != NULL )
-        ::CFRelease(r);
+        ::CFRelease((CFTypeRef)r);
 }
 
 /*! @function   wxCFRetain