Skip to content

Commit

Permalink
Fix memory leaks from orphaned event listeners
Browse files Browse the repository at this point in the history
  • Loading branch information
msssk committed Apr 18, 2020
1 parent 4eb5bc3 commit 32f8933
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
4 changes: 3 additions & 1 deletion ColumnSet.js
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,9 @@ define([
'.dgrid-column-set-scroller.dgrid-column-set-scroller-' + i +
'[' + colsetidAttr + '=' + i +']');
this._columnSetScrollerContents[i] = put(scroller, 'div.dgrid-column-set-scroller-content');
on(scroller, 'scroll', lang.hitch(this, '_onColumnSetScroll'));
this._listeners.push(
on(scroller, 'scroll', lang.hitch(this, '_onColumnSetScroll'))
);
},

_onColumnSetScroll: function (evt) {
Expand Down
8 changes: 5 additions & 3 deletions Keyboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,11 @@ define([

if (this.tabableHeader) {
enableNavigation(this.headerNode);
on(this.headerNode, 'dgrid-cellfocusin', function () {
grid.scrollTo({ x: this.scrollLeft });
});
this._listeners.push(
on(this.headerNode, 'dgrid-cellfocusin', function () {
grid.scrollTo({ x: this.scrollLeft });
})
);
}
enableNavigation(this.contentNode);

Expand Down

0 comments on commit 32f8933

Please sign in to comment.