commit | f0f6e80baee176b4608402d067a75c45be18d553 | [log] [tgz] |
---|---|---|
author | Miao Wang <miaowang@google.com> | Tue Feb 03 17:16:43 2015 -0800 |
committer | Miao Wang <miaowang@google.com> | Tue Feb 03 17:16:43 2015 -0800 |
tree | cd8f0c42fce8a64c71f14e4995d695a2043deb5a | |
parent | 53e8d6f934be403b9c7733c190b6052d60dd0658 [diff] |
make Allocation.destroy() include setSurface(null) for USAGE_IO_OUTPUT (Native RS) Change-Id: I23041da03c2c928ceec76037804abb5dc7e6eb64
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 @@ } } + /** + * For USAGE_IO_OUTPUT, destroy() implies setSurface(null). + * + */ + @Override + public void destroy() { + if((mUsage & USAGE_IO_OUTPUT) != 0) { + setSurface(null); + } + super.destroy(); + } }