Skip to content

Memory leak (particles list is not pruned) #4

Closed
@tkers

Description

@tkers

Hi! First of all, thanks for creating and sharing this library. I've started using this a while ago and it's been perfect for adding subtle effects to my games :)

However, after adding a lot of particles to my game (for example during playdate.update for a continuous effect like smoke), I realised the particles are not cleaned up properly and the performance starts dropping steadily.

I narrowed it down to the main particles table which adds, but never removes, each particle instance:

particles[#particles+1] = self

I'll try out some approaches to fix this and hopefully submit a PR later for this, but wanted to raise this issue in case you have any ideas regarding it already.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions