Event listeners leak in 2.0.1 #545

Closed
ghost opened this Issue Nov 13, 2013 · 3 comments

Comments

Projects
None yet
1 participant
@ghost

ghost commented Nov 13, 2013

Hello,

Here is the problem with event system in 2.0.1
http://jsfiddle.net/ga7cA/4/

You can see that 'children' event listeners are not destroyed properly after the control is destroyed and element content is removed.

There was no issue with 2.0.0

@justinbmeyer

This comment has been minimized.

Show comment
Hide comment
@justinbmeyer

justinbmeyer Nov 14, 2013

Contributor

Is it necessary to use the control in that example to create the memory leak?

Contributor

justinbmeyer commented Nov 14, 2013

Is it necessary to use the control in that example to create the memory leak?

@ghost

This comment has been minimized.

Show comment
Hide comment
@ghost

ghost Nov 14, 2013

I'm not really sure, it is more related to view rather than a control. I think the problem occurs when control element child nodes are removed multiple times. You can press the Reload button multiple times and see the result in the browser console - children array in __bindEvents will be growing.

ghost commented Nov 14, 2013

I'm not really sure, it is more related to view rather than a control. I think the problem occurs when control element child nodes are removed multiple times. You can press the Reload button multiple times and see the result in the browser console - children array in __bindEvents will be growing.

@justinbmeyer

This comment has been minimized.

Show comment
Hide comment
@justinbmeyer

justinbmeyer Nov 14, 2013

Contributor

I was stupidly not binding to a "change" event and unbinding it correctly. GREAT pickup. Seriously. It would have taken a while to notice that.

Contributor

justinbmeyer commented Nov 14, 2013

I was stupidly not binding to a "change" event and unbinding it correctly. GREAT pickup. Seriously. It would have taken a while to notice that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment