Open will093 opened 7 years ago
@will093 can you provide a plunker with the routing you are using?
@wizarrc I tried and failed to reproduce in the following Plunker which replicates the routing for the section of my application with the datatable:
https://plnkr.co/edit/uckO2V?p=info
I think the problem is related to the routing though, because if I load the component containing the datatable at a different place in the route hierarchy, it gets cleaned up as expected.
@will093 that's what I was thinking. There were some memory leaks that I fixed in the past, but never the whole thing, which leads me to believe it's a routing or another directive that's holding a reference thus not allowing garbage collection. If you notice part of the table not getting collected, it might be the table that has the leak.
I still have the same problem
I'm submitting a ... (check one with "x")
Current behavior
ngx-datatable and its parent component are not ever garbage collected after navigating away to another component, causing a memory leak.
Reproduction of the problem
Add a simple ngx-datatable to some component's template:
<ngx-datatable [rows]="[]" [columns]="[]"></ngx-datatable>
Then navigate away to another route, so that the component is no longer visible.
In the memory tab of the Chrome Dev Tools take a heap snapshot - the component with the ngx-datatable never gets garbage collected.
If I remove ngx-datatable from the component template, then the component does get garbage collected as expected.
Table version: 9.3.1
Angular version: 4.3.6
Browser: Chrome 60