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
This commit is contained in:
@@ -21,11 +21,14 @@
|
|||||||
|
|
||||||
/*! @function wxCFRelease
|
/*! @function wxCFRelease
|
||||||
@abstract A CFRelease variant that checks for NULL before releasing.
|
@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 )
|
if ( r != NULL )
|
||||||
::CFRelease(r);
|
::CFRelease((CFTypeRef)r);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*! @function wxCFRetain
|
/*! @function wxCFRetain
|
||||||
|
Reference in New Issue
Block a user