Revert "MemoryIntArray: don't double close."
The reverted change causes a regression where we can get an IllegalStateException
during finalization as we are adopting the native fd in a ParcelFileDescriptor
which takes ownership of the fd. However, the order of finalization is undefined
and if the ParcelFileDescriptor is finalized before the MemoryIntArray we would
get an exception when running the finalization of the latter.
This reverts commit 89dfbfa269.
bug:124056170
This commit is contained in:
committed by
Svetoslav Ganov
parent
db2d535782
commit
4cd7c896a6
@@ -142,6 +142,8 @@ static void android_util_MemoryIntArray_close(JNIEnv* env, jobject clazz, jint f
|
||||
jniThrowException(env, "java/io/IOException", "ashmem unpinning failed");
|
||||
return;
|
||||
}
|
||||
|
||||
close(fd);
|
||||
}
|
||||
|
||||
static jint android_util_MemoryIntArray_get(JNIEnv* env, jobject clazz,
|
||||
|
||||
Reference in New Issue
Block a user