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

Commit cb9e8253 authored by Chien-Yu Chen's avatar Chien-Yu Chen
Browse files

CameraSource: Close native handle if camera is closed

When releasing a native handle to camera, close the native
handle if camera is closed to avoid memory leak.

Bug: 30299751
Change-Id: I8e4758308e5efcb1e138aae7134cf71366baf468
parent 46c8f2d9
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -1117,6 +1117,9 @@ void CameraSource::releaseRecordingFrameHandle(native_handle_t* handle) {
        int64_t token = IPCThreadState::self()->clearCallingIdentity();
        mCamera->releaseRecordingFrameHandle(handle);
        IPCThreadState::self()->restoreCallingIdentity(token);
    } else {
        native_handle_close(handle);
        native_handle_delete(handle);
    }
}