mirror of
https://github.com/nasa/openmct.git
synced 2024-12-20 21:53:08 +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) {
|
function linkChart(scope, element) {
|
||||||
var canvas = element.find("canvas")[0],
|
var canvas = element.find("canvas")[0],
|
||||||
|
releaseInterval,
|
||||||
chart;
|
chart;
|
||||||
|
|
||||||
// Try to initialize GLChart, which allows drawing using WebGL.
|
// Try to initialize GLChart, which allows drawing using WebGL.
|
||||||
@ -111,11 +112,14 @@ define(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Check for resize, on a timer
|
// Check for resize, on a timer
|
||||||
$interval(drawIfResized, 1000);
|
releaseInterval = $interval(drawIfResized, 1000);
|
||||||
|
|
||||||
// Watch "draw" for external changes to the set of
|
// Watch "draw" for external changes to the set of
|
||||||
// things to be drawn.
|
// things to be drawn.
|
||||||
scope.$watchCollection("draw", doDraw);
|
scope.$watchCollection("draw", doDraw);
|
||||||
|
|
||||||
|
// Stop checking for resize when scope is destroyed
|
||||||
|
scope.$on("$destroy", releaseInterval);
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
Loading…
Reference in New Issue
Block a user