Skip to content

Conversation

@RenderCoder
Copy link

@RenderCoder RenderCoder commented Oct 12, 2022

Crash scenario

In dev mode, after call start function, the updateStats will continue working. After reload the project, need to cancel pervious dispatch_delay function, or will crash

Solution

  • use NSTimer replace dispatch_after, easy to start or stop
  • add notification observer for RCTBridgeWillReloadNotification, will stop NSTimer before reload

Other change

  • format source code, use 4 spaces

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