davetayls / jquery.kinetic

Add kinetic scrolling functionality to a container using mouse or touch devices
http://davetayls.me/jquery.kinetic
MIT License
420 stars 86 forks source link

Memory Cleanup for GC #99

Closed stevensanborn closed 8 years ago

stevensanborn commented 8 years ago

Im getting a leak using kinetic on my div:

Its only keeping around elements after using kinetic on my scrollable content:

`$content.kinetic({ x:false, y:true, cursor:"pointer", filterTarget: function(target, e){ return true; } }); $content.kinetic('detach');

` Detach is the only thing i see that does a kind of cleanup. Is there a better to destroy this , its keeping my element around in the JS heap ?

stevensanborn commented 8 years ago

Added a pull request , not sure if that does the trick entirely but it got rid of the detached nodes held in memory after the kinetic element was removed from the dom.

https://github.com/davetayls/jquery.kinetic/pull/100

tsaikd commented 8 years ago

Merged