-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[camera_avfoundation] dealloc camera on dispose (#7211)
When is camera disposed in `disposeCamera` it calls `close` and leaves `_camera` untouched so after another call to `sessionQueueCreateCameraWithName` it calls `close` second time and only here is `_camera` disposed by assigning new value into that variable. Calling `close` 2x may be unexpected and prone to later errors if someone adds here something which expects that it will be called only once. Also having dangling `_camera` after dispose (without creating new one) can have other unintended consequences although maybe benign for now. For example there is `[_motionManager stopAccelerometerUpdates]` which is called only in `dealloc`.
- Loading branch information
Showing
4 changed files
with
44 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters