Commit 85b951c
fix(android): Fix Android Camera1 race condition crash (react-native-camera#2781)
* add synchronized to take pictures callback in case camera was already stopped.
This will also prevent a possible null camera object.
* use our mCamera variable instead of the one received in the callback so we know if it has been disposed.
Co-authored-by: Cristiano Coelho <[email protected]>1 parent bfe04aa commit 85b951c
File tree
1 file changed
+16
-9
lines changed- android/src/main/java/com/google/android/cameraview
1 file changed
+16
-9
lines changedLines changed: 16 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
760 | 760 | | |
761 | 761 | | |
762 | 762 | | |
763 | | - | |
764 | | - | |
765 | | - | |
766 | | - | |
767 | | - | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
768 | 779 | | |
769 | | - | |
770 | | - | |
771 | | - | |
772 | | - | |
773 | 780 | | |
774 | 781 | | |
775 | 782 | | |
| |||
0 commit comments