react-native-vision-camera icon indicating copy to clipboard operation
react-native-vision-camera copied to clipboard

fix: fix ios reload by observing RCT module invalidate

Open mribbons opened this issue 2 years ago • 2 comments

What

Resolves IOS crash on reload

Screenshot 2023-07-12 at 4 19 15 pm

Changes

Store reference to viewTag Clear CameraView.frameProcessorCallback on RCTBridgeDidInvalidateModulesNotification

Tested on

iPad Pro 2017

Related issues

Fixes https://github.com/mrousavy/react-native-vision-camera/issues/1360

Inspired by https://github.com/software-mansion/react-native-reanimated/pull/3932

Note that this fix isn't perfect:

  1. There is no further cleanup being done
  2. There is definitively a memory leak

However despite this it should improve things considerably (Until v3), I was able to get around 15 reloads with no memory issues.

mribbons avatar Jul 12 '23 06:07 mribbons

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
react-native-vision-camera ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 12, 2023 6:39am

vercel[bot] avatar Jul 12 '23 06:07 vercel[bot]

Hey thanks for your Pr this is really interesting!

mrousavy avatar Jul 13 '23 12:07 mrousavy