Merge "Destroy Allocation right away on exception" am: 52bc790f61 am: a37bef769a am: fd9f091995

am: 26a5164479

Change-Id: I5017653d4a19b6a0e111f5ae5f0905cf7a5e7d2c
This commit is contained in:
Yang Ni
2017-05-08 16:22:04 +00:00
committed by android-build-merger

View File

@@ -2895,6 +2895,7 @@ public class Allocation extends BaseObj {
mAllocationArray[0] = createTyped(rs, t, usage);
if ((usage & USAGE_IO_INPUT) != 0) {
if (numAlloc > MAX_NUMBER_IO_INPUT_ALLOC) {
mAllocationArray[0].destroy();
throw new RSIllegalArgumentException("Exceeds the max number of Allocations allowed: " +
MAX_NUMBER_IO_INPUT_ALLOC);
}