This repository was archived by the owner on Feb 2, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 490
Angular Way Temporary Memory Leak with Datatables 1.10.x #319
Labels
Comments
Mmh interesting. The |
Hi @l-lin , I tried this and it seems to fix my problem. I've only tested with "Angular way" and Datatables 1.10.6. What do you think?
|
Yes, it does seem to work. Can you make a PR? |
Sorry for the delay; I just made a PR. |
Fixed with PR #326. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I have an "Angular way" angular-datatables, with an ng-repeat. The collection I iterate over in the ng-repeat is refreshed every 20 seconds, via an Ajax call.
Several of the tds in the table have a directive for HighCharts sparklines. The directive has a scope.$on('$destroy',...) where it cleans up. When I leave the page, the $destroy fires for every instance of the directive and all is good.
But when I stay on the page, new directives are compiled each time as a new set of rows are displayed. The existing rows with the compiled directives get detached, but are still around, as far as I can tell. Eventually the page starts getting sluggish and unresponsive as the objects keep accumulating, with their references to HighCharts.
I have created a Plunker to demonstrate the problem with all directives not getting destroyed. You can see in the Plunker that some of the directives are destroyed, but not all of them.
The leakage only happens with 1.10 datatables; it doesn't happen with 1.9. You can comment/uncomment the lines in index.html in the Plunker to specify which version of datatables to include and see the different behavior.
Thanks,
Charles
The text was updated successfully, but these errors were encountered: