Skip to content

Commit

Permalink
Reset handlers queue after finished replaying events
Browse files Browse the repository at this point in the history
Holding on to an array of CustomEvents can leak memory across page refreshes in
Chrome: https://crbug.com/529941

Fixes #2452
  • Loading branch information
dfreedm committed Sep 24, 2015
1 parent 573ca29 commit 76a5f17
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/standard/configure.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
// don't accept undefined values in intialConfig
for (var i in initialConfig) {
if (initialConfig[i] !== undefined) {
this._config[i] = initialConfig[i];
this._config[i] = initialConfig[i];
}
}
this._handlers = [];
Expand Down Expand Up @@ -190,8 +190,14 @@
for (var i=0, l=h$.length, h; (i<l) && (h=h$[i]); i++) {
h[0].call(this, h[1], h[2]);
}
// reset handlers array
//
// If an element holds a reference to a CustomEvent with a detail
// property, Chrome will leak memory across page refreshes
// https://crbug.com/529941
this._handlers = [];
}

});

</script>
</script>

0 comments on commit 76a5f17

Please sign in to comment.