googlearchive / core-style

Manage styling inside other elements and can be used to make themes.
https://www.polymer-project.org/0.5/docs/elements/core-style.html
10 stars 13 forks source link

<core-style ref=...> tags are never deallocated #20

Open david-saslawsky opened 9 years ago

david-saslawsky commented 9 years ago

The core-style consumers are added in global refMap but are never removed. Looks like a function to undo registerRef() is missing in detached

unregisterRef: function() {
    var idx = this.refMap[this.ref].indexOf(this);
    if(idx >= 0)
        this.refMap[this.ref].splice(idx, 1);
}

This is an issue because this prevents all the template instances of elements using core-style from being deallocated.

Kinetic915 commented 9 years ago

I have encountered this same issue as well, with its resulting memory leak.