{"action":"created","issue":{"url":"https://api.github.com/repos/bitovi/canjs/issues/1627","labels_url":"https://api.github.com/repos/bitovi/canjs/issues/1627/labels{/name}","comments_url":"https://api.github.com/repos/bitovi/canjs/issues/1627/comments","events_url":"https://api.github.com/repos/bitovi/canjs/issues/1627/events","html_url":"https://github.com/bitovi/canjs/issues/1627","id":69014642,"number":1627,"title":"Nested can.Component with <content/> tag causes detached DOM nodes","user":{"login":"akagomez","id":82166,"avatar_url":"https://avatars.githubusercontent.com/u/82166?v=3","gravatar_id":"","url":"https://api.github.com/users/akagomez","html_url":"https://github.com/akagomez","followers_url":"https://api.github.com/users/akagomez/followers","following_url":"https://api.github.com/users/akagomez/following{/other_user}","gists_url":"https://api.github.com/users/akagomez/gists{/gist_id}","starred_url":"https://api.github.com/users/akagomez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akagomez/subscriptions","organizations_url":"https://api.github.com/users/akagomez/orgs","repos_url":"https://api.github.com/users/akagomez/repos","events_url":"https://api.github.com/users/akagomez/events{/privacy}","received_events_url":"https://api.github.com/users/akagomez/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-04-16T21:34:09Z","updated_at":"2015-04-17T04:47:28Z","closed_at":null,"body":"![component-leak-2](https://cloud.githubusercontent.com/assets/82166/7191866/aaccc350-e45e-11e4-862a-9d495a4efb35.gif)\r\n\r\nCode found here: http://jsfiddle.net/akagomez/v8h1qfod/"},"comment":{"url":"https://api.github.com/repos/bitovi/canjs/issues/comments/93892550","html_url":"https://github.com/bitovi/canjs/issues/1627#issuecomment-93892550","issue_url":"https://api.github.com/repos/bitovi/canjs/issues/1627","id":93892550,"user":{"login":"imjoshdean","id":252054,"avatar_url":"https://avatars.githubusercontent.com/u/252054?v=3","gravatar_id":"","url":"https://api.github.com/users/imjoshdean","html_url":"https://github.com/imjoshdean","followers_url":"https://api.github.com/users/imjoshdean/followers","following_url":"https://api.github.com/users/imjoshdean/following{/other_user}","gists_url":"https://api.github.com/users/imjoshdean/gists{/gist_id}","starred_url":"https://api.github.com/users/imjoshdean/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/imjoshdean/subscriptions","organizations_url":"https://api.github.com/users/imjoshdean/orgs","repos_url":"https://api.github.com/users/imjoshdean/repos","events_url":"https://api.github.com/users/imjoshdean/events{/privacy}","received_events_url":"https://api.github.com/users/imjoshdean/received_events","type":"User","site_admin":false},"created_at":"2015-04-17T04:47:28Z","updated_at":"2015-04-17T04:47:28Z","body":"Incoming speculation, with links to lines in code:\r\n\r\nWhen we [replace the `<content/>` tag with the subtemplate](https://github.com/bitovi/canjs/blob/master/component/component.js#L344), we [never set `replacements`](https://github.com/bitovi/canjs/blob/master/view/node_lists/node_lists.js#L301)  on the node subtemplate nodeList [when we register it.](https://github.com/bitovi/canjs/blob/master/view/live/live.js#L463) So when we remove the component from the DOM and unregister the subtemplate nodeList, since [it doesn't have the `replacements` property, it doesn't get deleted from the nodeMap.](https://github.com/bitovi/canjs/blob/master/view/node_lists/node_lists.js#L328)\r\n\r\nAfter doing some work arounds to force the contents we replace `<content />` with to be seen as a parent element and, therefore, have that `replacements` array - I was able to remove your memory leak, but I'm sure we'll talk more in the morning."}}