From 6972616433058af17de07fcd4d5859cd899a3205 Mon Sep 17 00:00:00 2001 From: David Elliott Date: Sat, 12 May 2007 19:30:09 +0000 Subject: [PATCH] Make wxCFRef take a template raw pointer parameter instead of CFTypeRef to ensure it does not get called with a ref holder. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@46000 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/mac/corefoundation/cfref.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/include/wx/mac/corefoundation/cfref.h b/include/wx/mac/corefoundation/cfref.h index cabf81e616..7506791c0f 100644 --- a/include/wx/mac/corefoundation/cfref.h +++ b/include/wx/mac/corefoundation/cfref.h @@ -21,11 +21,14 @@ /*! @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 +inline void wxCFRelease(Type *r) { if ( r != NULL ) - ::CFRelease(r); + ::CFRelease((CFTypeRef)r); } /*! @function wxCFRetain -- 2.45.2