macOS bugfix: overrelease in wxGetAvailableDrives
as these strings are NSStrings retrieved by autoreleasing methods, they must be retained first
This commit is contained in:
@@ -76,4 +76,28 @@ public:
|
||||
private:
|
||||
} ;
|
||||
|
||||
/*! @function wxCFStringRefFromGet
|
||||
@abstract Factory function to create wxCFStringRefRef from a CFStringRef obtained from a Get-rule function
|
||||
@param p The CFStringRef to retain and create a wxCFStringRefRef from. May be NULL.
|
||||
@discussion Unlike the wxCFStringRef raw pointer constructor, this function explicitly retains its
|
||||
argument. This can be used for functions ) which return a temporary reference (Get-rule functions).
|
||||
*/
|
||||
inline wxCFStringRef wxCFStringRefFromGet(CFStringRef p)
|
||||
{
|
||||
return wxCFStringRef(wxCFRetain(p));
|
||||
}
|
||||
|
||||
#ifdef __WXMAC__
|
||||
/*! @function wxCFStringRefFromGet
|
||||
@abstract Factory function to create wxCFStringRefRef from a NSString* obtained from a Get-rule function
|
||||
@param p The NSString pointer to retain and create a wxCFStringRefRef from. May be NULL.
|
||||
@discussion Unlike the wxCFStringRef raw pointer constructor, this function explicitly retains its
|
||||
argument. This can be used for functions ) which return a temporary reference (Get-rule functions).
|
||||
*/
|
||||
inline wxCFStringRef wxCFStringRefFromGet(NSString *p)
|
||||
{
|
||||
return wxCFStringRefFromGet((CFStringRef)p);
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif //__WXCFSTRINGHOLDER_H__
|
||||
|
Reference in New Issue
Block a user