react-native-performance-stats icon indicating copy to clipboard operation
react-native-performance-stats copied to clipboard

fix: iOS crash when reload

Open RenderCoder opened this issue 3 years ago • 0 comments

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

RenderCoder avatar Oct 12 '22 06:10 RenderCoder