Repository navigation
fix(runtime): release wrappers made for JS methods called from native code #564
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
dccd5fc
fix(runtime): release wrappers made for JS methods called from native…
edusperoni 01082bc
fix(runtime): address review of the self-wrap leak fix
edusperoni ee736af
fix(runtime): keep JS overrides out of receiver wrapping, own init re…
edusperoni ad6045a
refactor(runtime): drop the unused skipGCRegistration parameter
edusperoni File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keep borrowed-receiver selection from treating weak-reference refusal as deallocation.
IsDeallocatingreturns true for any object whose class returnsNOfromallowsWeakReference, not only for objects in-dealloc. Such an object has noInstancesentry until JS first receives it. For a live native object of that kind that JS has never wrapped,WrapNativeCallbackSelftakes the borrowed path. The borrowed wrapper is never cached.BorrowedSelfScopethen detaches it after each callback, so each callback gets a new receiver. Properties that JS stores onthisare lost between callbacks.This affects only classes that refuse weak references while live, and only objects with no prior JS wrapper. The change needs a way to tell refusal from active deallocation before it selects the borrowed path. The current check does not provide one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Known and accepted; the comment on
IsDeallocatingsays so.-allowsWeakReferenceis the public signal that deallocation has begun, and telling a class that refuses weak references apart from an object that is deallocating needs_isDeallocating, which is private.It only affects an object of a class that refuses weak references while alive, and only when JS has never wrapped it. I know of no such class that gets subclassed from JS on iOS, so this stays as it is.