From f0f6e80baee176b4608402d067a75c45be18d553 Mon Sep 17 00:00:00 2001 From: Miao Wang Date: Tue, 3 Feb 2015 17:16:43 -0800 Subject: make Allocation.destroy() include setSurface(null) for USAGE_IO_OUTPUT (Native RS) Change-Id: I23041da03c2c928ceec76037804abb5dc7e6eb64 --- rs/java/android/renderscript/Allocation.java | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'rs/java/android') diff --git a/rs/java/android/renderscript/Allocation.java b/rs/java/android/renderscript/Allocation.java index 3cda6de..69103e8 100644 --- a/rs/java/android/renderscript/Allocation.java +++ b/rs/java/android/renderscript/Allocation.java @@ -1878,4 +1878,15 @@ public class Allocation extends BaseObj { } } + /** + * For USAGE_IO_OUTPUT, destroy() implies setSurface(null). + * + */ + @Override + public void destroy() { + if((mUsage & USAGE_IO_OUTPUT) != 0) { + setSurface(null); + } + super.destroy(); + } } -- cgit v1.1