Skip to content

Commit

Permalink
Merge pull request #759 from Clarvel/patch-1
Browse files Browse the repository at this point in the history
Fix copyBufferFromSource throwing an exception
  • Loading branch information
benfry authored Jul 31, 2023
2 parents 781b4f7 + f260a11 commit 89fb814
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions core/src/processing/opengl/Texture.java
Original file line number Diff line number Diff line change
Expand Up @@ -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<BufferData>();
}
usedBuffers.add(new BufferData(natRef, byteBuf.asIntBuffer(), w, h));
}
}

Expand Down Expand Up @@ -1667,4 +1666,4 @@ void dispose() {
}
}
}
}
}

0 comments on commit 89fb814

Please sign in to comment.