mirror of
https://github.com/nasa/openmct.git
synced 2025-06-01 15:10:50 +00:00
[Fixed Position] Free up resources
Free up resources when a fixed position view is destroyed, WTD-889.
This commit is contained in:
parent
71a132d374
commit
c2b1775d75
@ -124,6 +124,14 @@ define(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Free up subscription to telemetry
|
||||||
|
function releaseSubscription() {
|
||||||
|
if (subscription) {
|
||||||
|
subscription.unsubscribe();
|
||||||
|
subscription = undefined;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Subscribe to telemetry updates for this domain object
|
// Subscribe to telemetry updates for this domain object
|
||||||
function subscribe(domainObject) {
|
function subscribe(domainObject) {
|
||||||
// Clear any old values
|
// Clear any old values
|
||||||
@ -145,6 +153,9 @@ define(
|
|||||||
// Subscribe to telemetry when an object is available
|
// Subscribe to telemetry when an object is available
|
||||||
$scope.$watch("domainObject", subscribe);
|
$scope.$watch("domainObject", subscribe);
|
||||||
|
|
||||||
|
// Free up subscription on destroy
|
||||||
|
$scope.$on("$destroy", releaseSubscription);
|
||||||
|
|
||||||
// Initialize styles (position etc.) for cells
|
// Initialize styles (position etc.) for cells
|
||||||
refreshCellStyles();
|
refreshCellStyles();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user