diff options
-rw-r--r-- | rs/java/android/renderscript/Allocation.java | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/rs/java/android/renderscript/Allocation.java b/rs/java/android/renderscript/Allocation.java index 4e89566..e979a1b 100644 --- a/rs/java/android/renderscript/Allocation.java +++ b/rs/java/android/renderscript/Allocation.java @@ -1882,4 +1882,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(); + } } |