Skip to content

Commit

Permalink
Don't release actively used BufferBuilders
Browse files Browse the repository at this point in the history
  • Loading branch information
RaphiMC committed Nov 6, 2023
1 parent 60b2e0d commit 56b4f5c
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public static int getAllocatedSize() {
private static void cleanup() {
POOL.removeIf(b -> ((IBufferBuilder) b.getKey()).immediatelyFast$isReleased());
POOL.removeIf(b -> {
if (b.getValue() < System.currentTimeMillis() - 120_000) {
if (b.getValue() < System.currentTimeMillis() - 120_000 && !b.getKey().isBuilding()) {
((IBufferBuilder) b.getKey()).immediatelyFast$release();
return true;
}
Expand Down

0 comments on commit 56b4f5c

Please sign in to comment.