This repository was archived by the owner on Apr 4, 2023. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ class SizePair {
1919
2020// TODO pause/resume handling
2121export abstract class MLKitCameraView extends MLKitCameraViewBase {
22- private surfaceView : android . view . SurfaceView ;
22+ private surfaceView : any ; // android.view.SurfaceView;
2323 private bytesToByteBuffer = new Map ( ) ;
2424 private pendingFrameData = null ;
2525 protected rotation ;
@@ -29,24 +29,27 @@ export abstract class MLKitCameraView extends MLKitCameraViewBase {
2929
3030 disposeNativeView ( ) : void {
3131 super . disposeNativeView ( ) ;
32- if ( this . detector ) {
33- this . detector . close ( ) ;
34- this . detector = undefined ;
35- }
36- this . bytesToByteBuffer = new Map ( ) ;
3732 this . surfaceView = null ;
38-
33+
3934 if ( this . camera != null ) {
4035 this . camera . stopPreview ( ) ;
4136 this . camera . setPreviewCallbackWithBuffer ( null ) ;
4237 try {
4338 this . camera . setPreviewDisplay ( null ) ;
4439 } catch ( e ) {
45- console . log ( e ) ;
40+ console . log ( "Error cleaning up the ML Kit camera (you can probably ignore this): " + e ) ;
4641 }
4742 this . camera . release ( ) ;
4843 this . camera = null ;
4944 }
45+ this . bytesToByteBuffer . clear ( ) ;
46+
47+ if ( this . detector ) {
48+ this . detector . close ( ) ;
49+ this . detector = undefined ;
50+ }
51+ this . lastVisionImage = null ;
52+ this . pendingFrameData = null ;
5053 }
5154
5255 createNativeView ( ) : Object {
You can’t perform that action at this time.
0 commit comments