Skip to content

TM iOS: Remove retainArguments && do retain by us explicitly#24849

Closed
zhongwuzw wants to merge 1 commit into
facebook:masterfrom
zhongwuzw:TM_remove_retainArguments
Closed

TM iOS: Remove retainArguments && do retain by us explicitly#24849
zhongwuzw wants to merge 1 commit into
facebook:masterfrom
zhongwuzw:TM_remove_retainArguments

Conversation

@zhongwuzw
Copy link
Copy Markdown
Contributor

Summary

This is a TODO, we met crash if we don't call retainArguments when return type is like NSDictionary, the reason is getReturnValue don't retain the return value, so we need to using __bridge to transfer ownership to OC type.
Also add resolveBlock and rejectBlock to retainedObjectsForInvocation.

cc. @cpojer

Changelog

[iOS] [Fixed] - Remove retainArguments && do retain by us explicitly

Test Plan

TM example can run successfully.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label May 14, 2019
@react-native-bot react-native-bot added Platform: iOS iOS applications. Bug labels May 14, 2019
Copy link
Copy Markdown
Contributor

@matthargett matthargett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a unit test that demonstrates this new behavior?

@zhongwuzw zhongwuzw requested a review from fkgozali May 15, 2019 02:09
@zhongwuzw
Copy link
Copy Markdown
Contributor Author

@matthargett Yeah, I'll see how I can do it. :)

@RSNara
Copy link
Copy Markdown
Contributor

RSNara commented May 15, 2019

This is awesome! 😁

@zhongwuzw
Copy link
Copy Markdown
Contributor Author

zhongwuzw commented May 16, 2019

TM is still in progress, so I think we can't write unit test which integrated into CI? @RSNara
I may need your help about plans how and where we can write tests? 😂

Update: @matthargett After talking to Kevin, we can do it for later, maybe after TM is entirely ready. 🍻

Copy link
Copy Markdown
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fkgozali is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@react-native-bot
Copy link
Copy Markdown
Collaborator

This pull request was successfully merged by @zhongwuzw in a352ecf.

When will my fix make it into a release? | Upcoming Releases

@react-native-bot react-native-bot added the Merged This PR has been merged. label May 16, 2019
M-i-k-e-l pushed a commit to M-i-k-e-l/react-native that referenced this pull request Mar 10, 2020
…k#24849)

Summary:
This is a TODO, we met crash if we don't call `retainArguments` when return type is like `NSDictionary`, the reason is `getReturnValue` don't retain the return value, so we need to using `__bridge` to transfer ownership to OC type.
Also add `resolveBlock` and `rejectBlock` to `retainedObjectsForInvocation`.

cc. cpojer

## Changelog

[iOS] [Fixed] - Remove retainArguments && do retain by us explicitly
Pull Request resolved: facebook#24849

Differential Revision: D15369209

Pulled By: fkgozali

fbshipit-source-id: 8431d03705d8476f38c8b5d29630489a545d373a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Merged This PR has been merged. Native Module Platform: iOS iOS applications.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants