Addepar / ember-table

https://opensource.addepar.com/ember-table/
Other
1.69k stars 353 forks source link

Fix a memory leak with the root column tree node #994

Closed mmun closed 1 year ago

mmun commented 1 year ago

This PR fixes a memory leak that due to the root node not being destroyed when its dependency key columns is invalidated.

The reason this leaks memory is because some nodes in the ColumnTree structure add observers, and those observers are stored in a global map. If we don't explicitly destroy them the observers are never removed.

This exact pattern is already in use in this codebase for the CollapseTree: https://github.com/Addepar/ember-table/blob/master/addon/-private/collapse-tree.js#L810-L812

mixonic commented 1 year ago

I see it now. Excellent.