You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: own native blocks with Block_copy/Block_release
A block returned from a native method is +0 and may still be a stack
block. Interop::GetResult retained it with CFRetain and
ObjectManager::DisposeValue released it with CFRelease, but CFRetain does
not promote a stack block to the heap. By the time the JS wrapper was
finalized during GC the CFRelease ran against a freed stack frame and
crashed in objc_release (EXC_BAD_ACCESS).
Use Block_copy when taking ownership of the returned block (which moves a
stack block to the heap, or bumps the refcount of a heap/global block) and
Block_release as the matching counterpart on disposal.
0 commit comments