This commit is contained in:
hyb1996
2017-12-31 22:21:23 +08:00
parent c0dde41fc1
commit 3e592370dc
3 changed files with 16 additions and 0 deletions

View File

@@ -117,4 +117,16 @@ public class ImageWrapper {
public Bitmap getBitmap() {
return mBitmap;
}
public void recycle() {
if (mBitmap != null) {
mBitmap.recycle();
mBitmap = null;
}
if (mMat != null) {
mMat.release();
mMat = null;
}
}
}

View File

@@ -108,6 +108,9 @@ public class Images {
return mPreCaptureImage;
}
mPreCapture = capture;
if(mPreCaptureImage != null){
mPreCaptureImage.recycle();
}
mPreCaptureImage = ImageWrapper.ofImage(capture);
return mPreCaptureImage;
}