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

How to destroy and/or reload warpdrive #2

Closed
westonganger opened this issue Sep 18, 2018 · 6 comments

Comments

Projects
None yet
2 participants
@westonganger
Copy link

commented Sep 18, 2018

Getting major memory leaks when trying to remove the canvas and create a new one when settings change. Do you know of a way to solve or workaround this?

@NiklasKnaack

This comment has been minimized.

Copy link
Owner

commented Sep 19, 2018

Thanks for the hint. So far this plugin did not have such a method. For this reason I have added a new method called destroy. Have a look at the updated README.md, which explains how to use the new method. Let me know if it works now.

@westonganger

This comment has been minimized.

Copy link
Author

commented Sep 19, 2018

Great! The implementation looks fantastic. You sir are a gentleman and scholar.

This is good enough for me or could there a better way to reload the canvas with new settings, rather than destroy/re-init?

@NiklasKnaack

This comment has been minimized.

Copy link
Owner

commented Sep 20, 2018

Counter question: What exactly are you planning to do? Is there an example to look at?
Without further information I would say destroy/re-init is the right choice.

@westonganger

This comment has been minimized.

Copy link
Author

commented Sep 20, 2018

Im really just experimenting because this plugin is pretty cool but one use case is that I want to toggle Mouse/Touch. However really it could be any change of settings.

What I was thinking was to re-use somehow the existing canvas instead of destroying the element completely and creating a new one from scratch. My uneducated idea could be something as simple as clearing the canvas and re-drawing it or maybe there's something better without down the rabbit-hole too much.

@NiklasKnaack

This comment has been minimized.

Copy link
Owner

commented Sep 20, 2018

With some of the settings lookup tables are created. Therefore it is not possible to change some of the settings while running.
For example, to toggle between mouse/touch you would have to add a corresponding method. That would be quite simple.
I'm assuming this issue is resolved, so I'll close it soon.

@westonganger

This comment has been minimized.

Copy link
Author

commented Sep 20, 2018

Ok sounds good. Thank you very much for adding the destroy method. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.