can-value does not teardown binding #2270

Closed
dylanrtt opened this Issue Feb 16, 2016 · 0 comments

Comments

Projects
None yet
2 participants
@dylanrtt
Contributor

dylanrtt commented Feb 16, 2016

Introduced in 2.3.3. Still present on latest.

Creating a template like this with can-value doesn't remove the binding when the DOM is cleared.

var vm = new can.Map({ foo: '' });
var template = can.stache(`<div><input can-value="foo"></div>`);

$('#content').html(template(vm));
$('#content').empty(); // vm still has bindings

This does not happen with {($value)}.

http://jsbin.com/duxajaqige/edit?html,js,console

@justinbmeyer justinbmeyer self-assigned this Feb 16, 2016

justinbmeyer added a commit that referenced this issue Feb 17, 2016

@justinbmeyer justinbmeyer added the bug label Feb 17, 2016

@justinbmeyer justinbmeyer added this to the 2.3.17 milestone Feb 17, 2016

@dylanrtt dylanrtt changed the title from can-value memory leak to can-value does not teardown binding Feb 17, 2016

@daffl daffl closed this in #2271 Feb 19, 2016

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