Skip to content

Commit 790cec4

Browse files
committed
Merge pull request #35 from rebuy-de/byte_buffer_oom
Clear mBytesToByteBuffer to prevent out of memory exceptions
2 parents 825c73c + 72334f2 commit 790cec4

File tree

1 file changed

+3
-0
lines changed
  • visionSamples/barcode-reader/app/src/main/java/com/google/android/gms/samples/vision/barcodereader/ui/camera

1 file changed

+3
-0
lines changed

visionSamples/barcode-reader/app/src/main/java/com/google/android/gms/samples/vision/barcodereader/ui/camera/CameraSource.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -408,6 +408,9 @@ public void stop() {
408408
mProcessingThread = null;
409409
}
410410

411+
// clear the buffer to prevent oom exceptions
412+
mBytesToByteBuffer.clear();
413+
411414
if (mCamera != null) {
412415
mCamera.stopPreview();
413416
mCamera.setPreviewCallbackWithBuffer(null);

0 commit comments

Comments
 (0)