Open sparr opened 7 years ago
Just wondering, if it's garbage collecting every 10 secs, whats the main need to terminate it. What problems are you experiencing out of interest ?
In my immediate case, I'm running Snap in a non-browser environment that won't terminate while there are timers still running.
In general, even in a browser, it's bad practice to leave things running in the background long after the script has finished being used.
Sounds like a good reason!
hub isn't referenced too much, should be quite simple to turn this into a self invoking / self terminating timeout, either using a setter function or an explicit add to hub/cache function.
I'll have a go at knocking this off quickly as it's a small one.
https://github.com/adobe-webplatform/Snap.svg/blob/8c67c8ceaa6b4b2c7202c79297fe86532dacd03c/src/svg.js#L1321-L1330
No handle is kept for this timer, so there is no clean way to terminate it.
Also, if we can terminate it then we should be able to restart it.