Retain count fixes

This commit is contained in:
rfm 2024-11-10 14:14:42 +00:00
parent 44222342b0
commit 544dcce482
6 changed files with 111 additions and 21 deletions

View file

@ -187,6 +187,8 @@ pointerFunctionsRelinquish(PFInfo *PF, void **itemptr)
(*PF->relinquishFunction)(*itemptr, PF->sizeFunction);
if (memoryType(PF->options, NSPointerFunctionsWeakMemory))
WEAK_WRITE(itemptr, 0);
else if (memoryType(PF->options, NSPointerFunctionsStrongMemory))
STRONG_WRITE(itemptr, 0);
else
*itemptr = 0;
}
@ -203,7 +205,7 @@ pointerFunctionsReplace(PFInfo *PF, void **dst, void *src)
if (PF->relinquishFunction != 0)
(*PF->relinquishFunction)(*dst, PF->sizeFunction);
if (memoryType(PF->options, NSPointerFunctionsWeakMemory))
WEAK_WRITE(dst, 0);
WEAK_WRITE(dst, src);
else
*dst = src;
}