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

Commit b42479b7 authored by Hiroki Mine's avatar Hiroki Mine
Browse files

Fix the memory leak during high speed recording

During high speed recording, 4 CaptureResults are marked
in the mPartialResults at one time, but only 1 is removed.

This change fixes to remove requestCount of CaptureResults
at one time.

Bug: 271052477
Change-Id: I15efe031ef37315118f65b8a3e82f4aec68d9820
parent a057129f
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -2228,6 +2228,12 @@ public class CameraDeviceImpl extends CameraDevice
                } else {
                    List<CaptureResult> partialResults =
                            mFrameNumberTracker.popPartialResults(frameNumber);
                    if (mBatchOutputMap.containsKey(requestId)) {
                        int requestCount = mBatchOutputMap.get(requestId);
                        for (int i = 1; i < requestCount; i++) {
                            mFrameNumberTracker.popPartialResults(frameNumber - (requestCount - i));
                        }
                    }

                    final long sensorTimestamp =
                            result.get(CaptureResult.SENSOR_TIMESTAMP);