From 0ef708b34a5beb6dadb453880b7582984435f9f3 Mon Sep 17 00:00:00 2001 From: Kevin Fisher Date: Tue, 14 Jun 2016 23:30:48 -0500 Subject: [PATCH] Fix memory leak in setImage(Bitmap bmp) The Pix object was never recycled, causing it to never release image memory. --- tess-two/src/com/googlecode/tesseract/android/TessBaseAPI.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tess-two/src/com/googlecode/tesseract/android/TessBaseAPI.java b/tess-two/src/com/googlecode/tesseract/android/TessBaseAPI.java index e83178e49..799dcb412 100644 --- a/tess-two/src/com/googlecode/tesseract/android/TessBaseAPI.java +++ b/tess-two/src/com/googlecode/tesseract/android/TessBaseAPI.java @@ -514,6 +514,8 @@ public void setImage(Bitmap bmp) { } nativeSetImagePix(image.getNativePix()); + + image.recycle(); } /**