canjs / can-component

Custom elements and widgets
https://canjs.com/doc/can-component.html
MIT License
8 stars 8 forks source link

<content/> tag memory leak. #339

Closed bmomberger-bitovi closed 5 years ago

bmomberger-bitovi commented 5 years ago

In makeInsertionTagCallback the <content> [and possibly can-slots] are set up using addContext, which sets preventDataBindings on the DOM data state of content and slot elements. Since these elements never get added to the DOM, there's no removal mutation triggering a cleanup, and they stay resident in the can-dom-data-state removeDisposalMap.

It should suffice for this case to clean preventDataBindings from the elements after adding context.

bmomberger-bitovi commented 5 years ago

Fixed via some or all of #340, #341, #342, #344