mirror of
https://github.com/nasa/openmct.git
synced 2024-12-20 13:43:09 +00:00
[Performance] Release interval from mct-chart
Stop checking for size changes after scope is destroyed in mct-chart; part of ongoing resolution of resource leaks which may contribute to WTD-717.
This commit is contained in:
parent
a9f7cc9658
commit
5ee872713f
@ -46,6 +46,7 @@ define(
|
||||
|
||||
function linkChart(scope, element) {
|
||||
var canvas = element.find("canvas")[0],
|
||||
releaseInterval,
|
||||
chart;
|
||||
|
||||
// Try to initialize GLChart, which allows drawing using WebGL.
|
||||
@ -111,11 +112,14 @@ define(
|
||||
}
|
||||
|
||||
// Check for resize, on a timer
|
||||
$interval(drawIfResized, 1000);
|
||||
releaseInterval = $interval(drawIfResized, 1000);
|
||||
|
||||
// Watch "draw" for external changes to the set of
|
||||
// things to be drawn.
|
||||
scope.$watchCollection("draw", doDraw);
|
||||
|
||||
// Stop checking for resize when scope is destroyed
|
||||
scope.$on("$destroy", releaseInterval);
|
||||
}
|
||||
|
||||
return {
|
||||
|
Loading…
Reference in New Issue
Block a user