-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[1.x] Templatizer leaks instance <template> element and its dataHost onto prototype #5096
Comments
The offending line looks to be here: polymer/src/lib/template/templatizer.html Line 201 in 9721433
2.x does not appear to suffer from the same leak, as the polymer/lib/utils/templatize.html Lines 518 to 522 in 9b3ca2c
|
@kevinpschaaf I have updated your links to use permalinks to prevent linkrot and have nice in-lining of the corresponding source code |
[1.x] Ensure template instance isn't cached on prototype. Fixes #5096
This has been fixed in #5102 |
Description
The first time a template is "templatized", the reference to the
<template>
element instance is stored on the Templatized constructor's prototype, which is cached on the cached template content for any nested templates. This causes a leak not only of the template, but itsdataHost
reference, inadvertently causing a leak of potentially expensive elements all the way up the tree. The assumption is that once an element is detached and gc'ed, alldataHost
references back up the tree to it are also gc'ed. This leak via the<template>
element prevents proper gc from occurring.Live Demo
http://jsbin.com/remilab/edit?html,console,output
Steps to Reproduce
Open jsBin
Expected Results
No reference to the template's dataHost is retained
Actual Results
After being removed, the
instance
element is retained viaBrowsers Affected
All
Versions
The text was updated successfully, but these errors were encountered: