fix: Remove Frame Processor when Camera unmounts (#1960)

* unsetFrameProcessor when camera view is removed

* Use `this.lastFrameProcessor` instead

---------

Co-authored-by: Marc Rousavy <marcrousavy@hotmail.com>
This commit is contained in:
Tuan Luong 2023-10-10 23:55:08 +07:00 committed by GitHub
parent 18b30cd073
commit d51ac1529b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -431,6 +431,13 @@ export class Camera extends React.PureComponent<CameraProps> {
this.lastFrameProcessor = frameProcessor
}
}
/** @internal */
componentWillUnmount(): void {
if (this.lastFrameProcessor !== null) {
this.unsetFrameProcessor()
}
}
//#endregion
/** @internal */