From dbeb1e7ccebc7a2d790a272bd7e561024ff95a3d Mon Sep 17 00:00:00 2001 From: Evan Sarkar Date: Tue, 31 Mar 2026 06:26:36 +0530 Subject: [PATCH] fix: recycle particle instead of emitter position back to pool in ParticleSystem Pools.free(p) was incorrectly freeing the emitter's Point2D position instead of the expired particle, causing wrong objects to be recycled. --- .../src/main/kotlin/com/almasb/fxgl/particle/ParticleSystem.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fxgl-core/src/main/kotlin/com/almasb/fxgl/particle/ParticleSystem.kt b/fxgl-core/src/main/kotlin/com/almasb/fxgl/particle/ParticleSystem.kt index 121a49fc29..2cd6e6b010 100644 --- a/fxgl-core/src/main/kotlin/com/almasb/fxgl/particle/ParticleSystem.kt +++ b/fxgl-core/src/main/kotlin/com/almasb/fxgl/particle/ParticleSystem.kt @@ -48,7 +48,7 @@ class ParticleSystem : Updatable { iter.remove() pane.children.remove(particle.view) - Pools.free(p) + Pools.free(particle) } else { if (particle.view.parent == null) pane.children.add(particle.view)