-
Notifications
You must be signed in to change notification settings - Fork 182
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
Memory leak of UIPointerActions 'uidrag' #70
Comments
Thanks for reporting @cccdupont . We'll investigate as soon as possible. @tibotiber if you have a moment, would you be able to help us take a look and see if there's a quick fix? Thanks! |
Hi @cccdupont, very good catch, thank you :). And you're using @williamngan thanks for the ping. I had a quick look, our issue comes from
A fix for this would be to use something less volatile for the "id" of the members of What do you guys think? I can push a PR if you're good with the proposed solution. I'm open to better alternatives. |
Good catch, @tibotiber . Agreed that we should use something less volatile than an array index. How about if we store them in an object, and then use I'm open to any solution that you think it's best. Would greatly appreciate it if you have time to push a PR. Thank you so much @tibotiber 🙏 |
All good, pushed a PR and it seems to solve the memory leak. I went with your idea @williamngan, but I've used a Map instead of an object so keys can be numbers. There was another element to the leak, we were always holding events and creating events handlers even if they already existed, so I now make sure to hold and handle events only once. |
Pretty timely report @cccdupont, I've just met with this in my own app :). You saved me a good amount of debugging hours. |
@tibotiber @williamngan thank you for the quick fix ! |
@cccdupont 0.8.7 is published with the fix. Please give it a try and reopen this if you still encounter issues. @tibotiber thank you so much! |
@williamngan It's working perfectly now, thank you again ! Loving the UIDragger 👍 |
I've been wanting to use pts.js to draw interactive shapes. But the use of the "uidrag" action (i.e. for translating the shape) results in slowing down drastically the performances. Is this behaviour intended ? Or have I misused the "on" method of UIDragger ?
Fiddle to reproduce:
https://jsfiddle.net/ygov5x2m/ : click and drag on the shape, and open the console to see the issue.
pts version: 0.8.6
using Chromium 75.0.3770.90
The text was updated successfully, but these errors were encountered: