Skip to content

Conversation

booker0108
Copy link

Summary

To resolve the problem of handler being ARC on iOS [#390 ]

  • Create a strong reference in RNPermission.h
  • Add a method to store handler in NSDictionary and return a random ID for disposing after use

Test Plan

  • Create a memory-consuming app
  • Invoke Location permission request
  • Old implement might get to a situation that the dialog dismiss itself before user action because of aggressive ARC
  • New implementation will not encounter the issue as handler is now stored in a strong reference to prevent ARC

What's required for testing (prerequisites)?

  • A bulky app which cause the bug (Release mode only)

What are the steps to reproduce (after prerequisites)?

  • Invoke Location permission request

Compatibility

OS Implemented
iOS
Android ❌ (Not applicable)

Checklist

  • I have tested this on a device and a simulator
  • I added the documentation in README.md
  • I mentioned this change in CHANGELOG.md
  • I updated the typed files (TS and Flow)
  • I added a sample use of the API in the example project (example/App.js)

@booker0108 booker0108 requested a review from zoontek as a code owner January 3, 2020 04:08
@zoontek
Copy link
Owner

zoontek commented Jan 5, 2020

LGTM 👍

@zoontek zoontek merged commit 570ab88 into zoontek:master Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants