From c3a56c900291efaf3ee7024a0ffa5dce098cc5f2 Mon Sep 17 00:00:00 2001 From: Ron Budnar Date: Mon, 28 Sep 2026 00:20:09 -0500 Subject: [PATCH] fix(ios): preserve object return from generated retain override --- NativeScript/runtime/ClassBuilder.mm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/NativeScript/runtime/ClassBuilder.mm b/NativeScript/runtime/ClassBuilder.mm index 012f1fdc..5b91128b 100644 --- a/NativeScript/runtime/ClassBuilder.mm +++ b/NativeScript/runtime/ClassBuilder.mm @@ -311,9 +311,9 @@ void ScopeClassNameToIsolate(std::string& name, int isolateId) { /// instances map), we unprotect the corresponding JavaScript object in order to make both /// of them destroyable/GC-able. When the JavaScript object is GC-ed we release the native /// counterpart as well. - void (*retain)(id, SEL) = - (void (*)(id, SEL))FindNotOverridenMethod(extendedClass, @selector(retain)); - IMP newRetain = imp_implementationWithBlock(^(id self) { + id (*retain)(id, SEL) = + (id (*)(id, SEL))FindNotOverridenMethod(extendedClass, @selector(retain)); + IMP newRetain = imp_implementationWithBlock(^id(id self) { if (!isolateWrapper.IsValid()) { return retain(self, @selector(retain)); }