Skip to content

Scroll and Resize handlers stay on memory #57

@edwardbc

Description

@edwardbc

I've noticed that $(context).scroll and $(context).resize are currently staying in memory, carrying with the the whole Context object in memory even after destroy has been called.

Since both are shortcuts to jQuery bind, it's recommended to 'unbind' both on the plugin's destroy call.
https://github.com/imakewebthings/jquery-waypoints/blob/master/waypoints.js#L160

Would it be possible to unbind both of this event handlers in order to avoid memory leaks? This is important due the fact that in a SPA , waypoint handlers are being triggered in other pages after the plugin destroy method have been called and the Context variable is not being picked up by the GC because of these bindings.

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions