Fix issue with updating props quickly causing released camera object to be accessed. (#507)
This commit is contained in:
parent
536d39b33b
commit
f696610115
|
@ -49,9 +49,11 @@ public class RCTCamera {
|
|||
}
|
||||
|
||||
public void releaseCameraInstance(int type) {
|
||||
if (null != _cameras.get(type)) {
|
||||
_cameras.get(type).release();
|
||||
// Release seems async and creates race conditions. Remove from map first before releasing.
|
||||
Camera releasingCamera = _cameras.get(type);
|
||||
if (null != releasingCamera) {
|
||||
_cameras.remove(type);
|
||||
releasingCamera.release();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue