summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2011-03-30 14:20:14 +0200
committerSven Gothel <[email protected]>2011-03-30 14:20:14 +0200
commitff32688c4520373468315b6dad4ec26f481bcd00 (patch)
tree7ac8b401d82e5a472876a3d89c7153abf6c42ee0 /src
parentdbc74b98eb7429cbb51f7af0572ab53ddd0d9edc (diff)
Avoid NPE in Screenshot/ReadBufferUtil
Diffstat (limited to 'src')
-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;
}