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

It would be nice if we can destroy timeline gracefully. #1295

Closed
PVirie opened this issue Apr 6, 2023 · 3 comments
Closed

It would be nice if we can destroy timeline gracefully. #1295

PVirie opened this issue Apr 6, 2023 · 3 comments

Comments

@PVirie
Copy link

PVirie commented Apr 6, 2023

Timeline.terminate()

I am using svg.js to create a math tutorial web blog. It does the job nicely. Just one thing though..

Suppose that we have a script that uses svg.js, consider these conditions:

  1. The script uses a lot of persisting Runners (to make animations revertible).
  2. The script needs to replace and re-populate Timelines with those Runners.

For some reasons, javascript does not clean up Timelines properly and leaves a lot of occupying memory footprints.
I have been cleaning up Runners in Timelines manually. But it would be nice if you make an official support for this feature.

So instead of using this:

timeline._runners = [];

It would be nice if we can

timeline.terminate();

I will be happy if you could consider my request. Thank you in advance.

@Fuzzyma
Copy link
Member

Fuzzyma commented Sep 2, 2023

see 29b2bd7 for implementation

sorry that it took so long

@Fuzzyma Fuzzyma closed this as completed Sep 2, 2023
@oliverschenk
Copy link

Will there be a release version for this?

@Fuzzyma
Copy link
Member

Fuzzyma commented Jun 18, 2024

I am sorry, I somehow forgot to publish all the fixes I made. I just released it:
https://github.com/svgdotjs/svg.js/releases/tag/3.2.1

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

3 participants