Skip to content

Commit 89fb814

Browse files
authored
Merge pull request #759 from Clarvel/patch-1
Fix copyBufferFromSource throwing an exception
2 parents 781b4f7 + f260a11 commit 89fb814

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

core/src/processing/opengl/Texture.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -823,11 +823,10 @@ public void copyBufferFromSource(Object natRef, ByteBuffer byteBuf,
823823
} else {
824824
// The buffer cache reached the maximum size, so we just dispose
825825
// the new buffer by adding it to the list of used buffers.
826-
try {
827-
usedBuffers.add(new BufferData(natRef, byteBuf.asIntBuffer(), w, h));
828-
} catch (Exception e) {
829-
e.printStackTrace();
826+
if (usedBuffers == null) {
827+
usedBuffers = new LinkedList<BufferData>();
830828
}
829+
usedBuffers.add(new BufferData(natRef, byteBuf.asIntBuffer(), w, h));
831830
}
832831
}
833832

@@ -1667,4 +1666,4 @@ void dispose() {
16671666
}
16681667
}
16691668
}
1670-
}
1669+
}

0 commit comments

Comments
 (0)