fix: implement more robust config and tear down bookkeeping#3664
fix: implement more robust config and tear down bookkeeping#3664rustle wants to merge 5 commits intomrousavy:mainfrom
Conversation
- Add shutdown method to stop all outputs and release resources - Schedule shutdown with warning if it takes longer than expected
* Cleaning up capture sessions in deinit likely indicates some bookkeeping isn't completing and is likely to obscure rather than fix bugs * Adding a completion handler to config adds a lot of complexity we can avoid and replace with a more correct DispatchGroup (the group doesn't notify until any async audio and location work complete) * Switch existing DispatchTime usage for dropping redundant config calls to a simple monotonic counter that uses an unfair lock * remove didScheduleShutdown as deactivateCameraSession() is safe to call repeatedly
|
@rustle is attempting to deploy a commit to the mrousavy's Team Team on Vercel. A member of the Team first needs to authorize it. |
mrousavy
left a comment
There was a problem hiding this comment.
Thanks for your PR!
Left some comments
cd7d8ff to
eb07d6a
Compare
|
I've added a comment to explain the manual delegate cleanup and made the work in deinit much smaller and synchronous, but if your preference is still to drop those neither are strictly necessary for this PR to work well. |
|
I have a problem with the library; the phone no longer enters sleep mode after passing over a screen with a camera. Testing this PR solved my problem. Do you have an estimated date for accepting this PR or creating a test version? @mrousavy |
|
This PR works! Thank you for this fix 🚀 |
|
Would love to upstream this. We're here to address any feedback. |
What
This is a revision pass on the work done in #3650
Fix the navigation freeze on React Navigation/Fabric by shutting the camera session down deterministically when the view unmounts.
Changes
Instead of introducing a new shutdown method revise use of configure
Tested on
iPhone 12 mini running 18.7.1
Related issues