fix: Frame Processor error when frame processors aren't used

This commit is contained in:
Marc Rousavy 2021-05-19 10:13:20 +02:00
parent 310ad5fc4c
commit ff890abebf

View File

@ -343,9 +343,11 @@ export class Camera extends React.PureComponent<CameraProps> {
* @internal
*/
componentWillUnmount(): void {
this.assertFrameProcessorsEnabled();
// @ts-expect-error JSI functions aren't typed
global.unsetFrameProcessor(this.handle);
if (this.lastFrameProcessor != null || this.props.frameProcessor != null) {
this.assertFrameProcessorsEnabled();
// @ts-expect-error JSI functions aren't typed
global.unsetFrameProcessor(this.handle);
}
}
/**