diff options
Diffstat (limited to 'rs/java/android')
-rw-r--r-- | rs/java/android/renderscript/Allocation.java | 1 | ||||
-rw-r--r-- | rs/java/android/renderscript/ScriptIntrinsicLUT.java | 4 |
2 files changed, 5 insertions, 0 deletions
diff --git a/rs/java/android/renderscript/Allocation.java b/rs/java/android/renderscript/Allocation.java index 05ad1615dc81..238bf0f5a335 100644 --- a/rs/java/android/renderscript/Allocation.java +++ b/rs/java/android/renderscript/Allocation.java @@ -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); } diff --git a/rs/java/android/renderscript/ScriptIntrinsicLUT.java b/rs/java/android/renderscript/ScriptIntrinsicLUT.java index 69ff64acdf90..e90462d11124 100644 --- a/rs/java/android/renderscript/ScriptIntrinsicLUT.java +++ b/rs/java/android/renderscript/ScriptIntrinsicLUT.java @@ -56,6 +56,10 @@ public final class ScriptIntrinsicLUT extends ScriptIntrinsic { } + public void destroy() { + mTables.destroy(); + super.destroy(); + } private void validate(int index, int value) { if (index < 0 || index > 255) { |