Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

App terminated due to memory issue #18

Open
MartinAtElitappar opened this issue Mar 13, 2023 · 1 comment
Open

App terminated due to memory issue #18

MartinAtElitappar opened this issue Mar 13, 2023 · 1 comment

Comments

@MartinAtElitappar
Copy link

Hi, thanks for this nice effect-library! I use ConfettiView which works perfectly. Unfortunately, this is not the case with FireWorksView, which causes memory problems. When I run FireWorksView it doesn't release all the memory, and running it again makes the problem even more apparent. Then it consumes memory continuously and builds more and more memory until the app crashes. I am running SwiftUI and latest release of iOS and Xcode.

@jonklein
Copy link

Looks like the issue is that fireworks explosions are continually added to the scene and never removed. A quick fix is in FireworksScene.swift, at the end of func explosion(at point: CGPoint), to add:

DispatchQueue.main.asyncAfter(deadline: .now() + 3.0) { node.removeFromParent() }

(I'd put in a PR for this, but looks like this is an old issue and the repo is not really being maintained)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants