summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/demo/ReadBufferUtil.java8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/demo/ReadBufferUtil.java b/src/demo/ReadBufferUtil.java
index 1de61974b..9a2da0d7e 100644
--- a/src/demo/ReadBufferUtil.java
+++ b/src/demo/ReadBufferUtil.java
@@ -95,11 +95,13 @@ public class ReadBufferUtil {
}
@SuppressWarnings("deprecation")
- public void dispose() {
+ public void dispose() {
readTexture.dispose();
readTextureData = null;
- readPixelBuffer.clear();
- readPixelBuffer = null;
+ if(null != readPixelBuffer) {
+ readPixelBuffer.clear();
+ readPixelBuffer = null;
+ }
readPixelSizeLast = 0;
}