googlearchive / core-list

Polymer virtualized list element
25 stars 20 forks source link

Potential memory leak in core-list #55

Closed david-saslawsky closed 9 years ago

david-saslawsky commented 9 years ago

updateSize is still called when you resize the window after the element has been detached. This is easy to reproduce with app-router.

The following change fixes the problem for me:

    detached: function() {
//     this.removeEventListener(this._boundScrollHandler);
//     this.removeEventListener(this._boundResizeHandler);
      if(this._target)
        this._target.removeEventListener('scroll',this._boundScrollHandler);
      window.removeEventListener('resize',this._boundResizeHandler);
    },
kevinpschaaf commented 9 years ago

Thank you @david-saslawsky! Good catch.