fix(renderer): Prevent releasing the same RenderingBo object in put methods

This commit is contained in:
extio-de
2025-12-25 16:16:27 +01:00
parent b2c7747782
commit 53efaa0455

View File

@@ -30,7 +30,7 @@ public class RendererWorkingSetImpl implements RendererWorkingSet {
final var previous = this.getWorkingSetByProducer(producerId) final var previous = this.getWorkingSetByProducer(producerId)
.next() .next()
.put(work.getId(), work); .put(work.getId(), work);
if (previous != null) { if (previous != null && previous != work) {
this.rendererBoPool.release(previous); this.rendererBoPool.release(previous);
} }
} }
@@ -40,7 +40,7 @@ public class RendererWorkingSetImpl implements RendererWorkingSet {
final var nextMap = this.getWorkingSetByProducer(producerId).next(); final var nextMap = this.getWorkingSetByProducer(producerId).next();
for (final RenderingBo bo : work) { for (final RenderingBo bo : work) {
final var previous = nextMap.put(bo.getId(), bo); final var previous = nextMap.put(bo.getId(), bo);
if (previous != null) { if (previous != null && previous != bo) {
this.rendererBoPool.release(previous); this.rendererBoPool.release(previous);
} }
} }