Skip to content
Snippets Groups Projects
Commit 867ac4d5 authored by Yang Ni's avatar Yang Ni
Browse files

Destroy Allocation right away on exception

Bug: 28053584

To avoid holding the resource (surface) for too long.

Test: CTS on x86_64 emulator
Change-Id: I2fdec107c2a16b7dadbf78a9aee79c33423a3676
(cherry picked from commit c48a09cc)
parent 8cfb1a95
No related branches found
No related tags found
No related merge requests found
......@@ -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);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment