Correct the fix for the FFI invocation memory leak.

This commit is contained in:
rfm 2025-01-09 06:21:48 +00:00
parent 05d34f1a30
commit cf8c387900
2 changed files with 12 additions and 2 deletions

View file

@ -308,8 +308,17 @@ relinquishRetainedMemory(const void *item,
break;
case NSPointerFunctionsOpaquePersonality:
_x.acquireFunction = 0;
_x.relinquishFunction = 0;
if (NSPointerFunctionsMachVirtualMemory == memoryType
|| NSPointerFunctionsMallocMemory == memoryType)
{
_x.acquireFunction = acquireMallocMemory;
_x.relinquishFunction = relinquishMallocMemory;
}
else
{
_x.acquireFunction = 0;
_x.relinquishFunction = 0;
}
_x.descriptionFunction = describePointer;
_x.hashFunction = hashShifted;
_x.isEqualFunction = equalDirect;

View file

@ -383,6 +383,7 @@ _arg_addr(NSInvocation *inv, int index)
* we can release it.
*/
[((GSFFIInvocation*)self)->_frame release];
[((GSFFIInvocation*)self)->_extra release];
}
#elif defined(USE_FFCALL)
if (_cframe)