Skip to content

Commit b429ddd

Browse files
authored
Merge pull request #59 from fusioncharts/core-fix/memory-leak-issue
Core fix/memory leak issue
2 parents b4db9e6 + bd2f367 commit b429ddd

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

dist/angular-fusioncharts.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -474,6 +474,12 @@
474474

475475
createFCChart();
476476

477+
scope.$on('$destroy', function () {
478+
// on destroy free used resources to avoid memory leaks
479+
if (chart && chart.dispose) {
480+
chart.dispose();
481+
}
482+
});
477483
}
478484
};
479485
}]);

dist/angular-fusioncharts.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/angular-fusioncharts.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -474,6 +474,12 @@
474474

475475
createFCChart();
476476

477+
scope.$on('$destroy', function () {
478+
// on destroy free used resources to avoid memory leaks
479+
if (chart && chart.dispose) {
480+
chart.dispose();
481+
}
482+
});
477483
}
478484
};
479485
}]);

0 commit comments

Comments
 (0)