vimalavinisha / angular2-google-chart

Angular 2 google chart
MIT License
59 stars 45 forks source link

Added clearChart() method in OnDestroy to avoid memory leak and added lexical this #47

Closed GustavoCostaW closed 6 years ago

GustavoCostaW commented 7 years ago

I add the clearChart() method in OnDestroy to avoid memory leak in the application.

See my heap, memory and listeners tests:

Showing 10 charts and toggle with *ngIf to remove and add in the DOM for 20s:

You can see the memory leak and garbage collector not working.

And my pull request with the same tests. (heap and listeners decrease when I remove from the DOM)