From ff32688c4520373468315b6dad4ec26f481bcd00 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Wed, 30 Mar 2011 14:20:14 +0200 Subject: Avoid NPE in Screenshot/ReadBufferUtil --- src/demo/ReadBufferUtil.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src') 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; } -- cgit v1.2.3 From d06d5596d18101c876c869a514e42e795ee9357c Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Wed, 30 Mar 2011 14:47:19 +0200 Subject: Demo/Test: Use public API --- src/demo/GPURegionRendererListenerBase01.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/demo/GPURegionRendererListenerBase01.java b/src/demo/GPURegionRendererListenerBase01.java index 19742a17a..39a920656 100644 --- a/src/demo/GPURegionRendererListenerBase01.java +++ b/src/demo/GPURegionRendererListenerBase01.java @@ -27,9 +27,8 @@ */ package demo; -import jogamp.graph.curve.opengl.RegionRendererImpl01; - import com.jogamp.graph.curve.OutlineShape; +import com.jogamp.graph.curve.opengl.RegionRenderer; import com.jogamp.graph.geom.Vertex; /** @@ -48,6 +47,6 @@ public abstract class GPURegionRendererListenerBase01 extends GPURendererListene OutlineShape outlineShape = null; public GPURegionRendererListenerBase01(Vertex.Factory factory, int mode, boolean debug, boolean trace) { - super(new RegionRendererImpl01(factory, mode), debug, trace); + super(RegionRenderer.create(factory, mode), debug, trace); } } \ No newline at end of file -- cgit v1.2.3