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

Bug: destructor cleanup #75

Open
Andrewknackstedt opened this issue Feb 7, 2023 · 2 comments
Open

Bug: destructor cleanup #75

Andrewknackstedt opened this issue Feb 7, 2023 · 2 comments

Comments

@Andrewknackstedt
Copy link

Follow-up of #72 and #74
Already seeing much better cleanup and far less CPU is used after the destructor is called, getting much closer to being done :)

There is still some FrameTicker straggler that isn't being cleaned up, though I'm not 100% sure why or where it's coming from.
It looks like we need this._isRunning set to false to fully kill FrameTicker. It's a bit surprising that FrameTicker's destructor wouldn't take care of that.

This animation isn't being stopped:

requestAnimationFrame(onFrame);

This animation seems to not be cleaned up?
https://github.com/vasturiano/globe.gl/blob/805f2c018c89c2bcb3a9a4951b686960e0c0b213/src/globe.js#L249

@vasturiano
Copy link
Owner

It looks like we need this._isRunning set to false to fully kill FrameTicker. It's a bit surprising that FrameTicker's destructor wouldn't take care of that.

Maybe it's worth taking that up to the frame-ticker repo?

This animation isn't being stopped:
three-globe/src/globe-kapsule.js

It is on the recent version:

cancelAnimationFrame(state.animationFrameRequestId);

This animation seems to not be cleaned up?
https://github.com/vasturiano/globe.gl/blob/805f2c018c89c2bcb3a9a4951b686960e0c0b213/src/globe.js#L249

Should be, as part of pauseAnimation:
https://github.com/vasturiano/globe.gl/blob/805f2c018c89c2bcb3a9a4951b686960e0c0b213/src/globe.js#L304

@Andrewknackstedt
Copy link
Author

I believe I fixed the logic and opened a PR on FrameTicker
https://github.com/knackstedt/frame-ticker

I used the latest version and was still seeing some loops around those areas, but I might have been following a red herring due to FrameTicker not ensuring the animation got stopped

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