diff --git a/core/src/processing/opengl/Texture.java b/core/src/processing/opengl/Texture.java index ecb67681b..5624aa772 100644 --- a/core/src/processing/opengl/Texture.java +++ b/core/src/processing/opengl/Texture.java @@ -823,11 +823,10 @@ public void copyBufferFromSource(Object natRef, ByteBuffer byteBuf, } else { // The buffer cache reached the maximum size, so we just dispose // the new buffer by adding it to the list of used buffers. - try { - usedBuffers.add(new BufferData(natRef, byteBuf.asIntBuffer(), w, h)); - } catch (Exception e) { - e.printStackTrace(); + if (usedBuffers == null) { + usedBuffers = new LinkedList(); } + usedBuffers.add(new BufferData(natRef, byteBuf.asIntBuffer(), w, h)); } } @@ -1667,4 +1666,4 @@ void dispose() { } } } -} \ No newline at end of file +}