mirror of
https://github.com/nasa/openmct.git
synced 2025-03-21 19:45:23 +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
|
||||
function subscribe(domainObject) {
|
||||
// Clear any old values
|
||||
@ -145,6 +153,9 @@ define(
|
||||
// Subscribe to telemetry when an object is available
|
||||
$scope.$watch("domainObject", subscribe);
|
||||
|
||||
// Free up subscription on destroy
|
||||
$scope.$on("$destroy", releaseSubscription);
|
||||
|
||||
// Initialize styles (position etc.) for cells
|
||||
refreshCellStyles();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user