Merge "ImageReader: Make close thread safe" into nyc-mr1-dev

This commit is contained in:
Chien-Yu Chen
2016-07-19 21:05:35 +00:00
committed by Android (Google) Code Review

View File

@@ -512,11 +512,11 @@ public class ImageReader implements AutoCloseable {
mAcquiredImages.clear();
nativeClose();
}
if (mEstimatedNativeAllocBytes > 0) {
VMRuntime.getRuntime().registerNativeFree(mEstimatedNativeAllocBytes);
mEstimatedNativeAllocBytes = 0;
if (mEstimatedNativeAllocBytes > 0) {
VMRuntime.getRuntime().registerNativeFree(mEstimatedNativeAllocBytes);
mEstimatedNativeAllocBytes = 0;
}
}
}