Skip to content

Commit eabd4c5

Browse files
committed
[[ Bug ]] Fix over-release crash in ListToNSArray
This patch fixes an over-release of any objective-c objects that are elements of a list passed to `ListToNSArray`. `MCValueConvertToCFTypeRef` should return a retained object which will be released when `MCAutoCustomPointer<const void, CFDeleter> t_cf_value;` goes out of scope. (cherry picked from commit 3688b01)
1 parent 3f86720 commit eabd4c5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

libfoundation/src/foundation-cf.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -514,7 +514,7 @@ bool MCValueConvertToCFTypeRef(MCValueRef p_value, bool p_use_lists, CFTypeRef&
514514
default:
515515
if (MCValueGetTypeInfo(p_value) == kMCObjcObjectTypeInfo)
516516
{
517-
r_cf_type = MCObjcObjectGetId((MCObjcObjectRef)p_value);
517+
r_cf_type = CFRetain(MCObjcObjectGetId((MCObjcObjectRef)p_value));
518518
return true;
519519
}
520520
break;

0 commit comments

Comments
 (0)