Skip to content

fix: recycle particle instead of emitter position back to pool in ParticleSystem#1470

Open
evanofficial wants to merge 1 commit intoAlmasB:devfrom
evanofficial:fix-particle-system-pool-free
Open

fix: recycle particle instead of emitter position back to pool in ParticleSystem#1470
evanofficial wants to merge 1 commit intoAlmasB:devfrom
evanofficial:fix-particle-system-pool-free

Conversation

@evanofficial
Copy link
Copy Markdown

Fixes #1417

In ParticleSystem.onUpdate, when a particle expires it should be returned to the object pool via Pools.free(particle). Instead, Pools.free(p) was being called, which freed the emitter's Point2D position — a completely different object.

Changed Pools.free(p)Pools.free(particle) on the removal path.

…ticleSystem

Pools.free(p) was incorrectly freeing the emitter's Point2D position
instead of the expired particle, causing wrong objects to be recycled.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant