Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 664d72e6 authored by Chih-yu Huang's avatar Chih-yu Huang
Browse files

Clear callbacks in camera stopPreview.

Clear those callbacks to remove the references
so the memory can be recycled.

bug:5358774
Change-Id: I3b6034a1891126b3437a6744013f38a64f5bb03b
parent dd33bf0e
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -480,6 +480,12 @@ public class Camera {
    public final void stopPreview() {
        _stopPreview();
        mFaceDetectionRunning = false;

        mShutterCallback = null;
        mRawImageCallback = null;
        mPostviewCallback = null;
        mJpegCallback = null;
        mAutoFocusCallback = null;
    }

    private native final void _stopPreview();