mirror of
https://github.com/nasa/openmct.git
synced 2025-02-04 10:10:43 +00:00
gui still leaking data
This commit is contained in:
parent
484a81b370
commit
446c8119c3
@ -88,6 +88,20 @@ export default class CompsManager extends EventEmitter {
|
||||
this.#telemetryLoadedPromises = [];
|
||||
}
|
||||
|
||||
startListeningToUnderlyingTelemetry() {
|
||||
Object.keys(this.#telemetryCollections).forEach((keyString) => {
|
||||
if (!this.#telemetryCollections[keyString].loaded) {
|
||||
this.#telemetryCollections[keyString].load();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
stopListeningToUnderlyingTelemetry() {
|
||||
Object.keys(this.#telemetryCollections).forEach((keyString) => {
|
||||
this.#telemetryCollections[keyString].destroy();
|
||||
});
|
||||
}
|
||||
|
||||
getTelemetryObjects() {
|
||||
return this.#telemetryObjects;
|
||||
}
|
||||
|
@ -105,9 +105,12 @@ export default class CompsTelemetryProvider {
|
||||
specificCompsManager.on('underlyingTelemetryUpdated', (newTelemetry) => {
|
||||
this.#computeOnNewTelemetry(specificCompsManager, newTelemetry, callbackID);
|
||||
});
|
||||
specificCompsManager.startListeningToUnderlyingTelemetry();
|
||||
return () => {
|
||||
specificCompsManager.off('calculationUpdated', callback);
|
||||
specificCompsManager.off('underlyingTelemetryUpdated', callback);
|
||||
delete this.#subscriptionCallbacks[callbackID];
|
||||
// if this is the last subscription, tell the comp manager to stop listening
|
||||
specificCompsManager.stopListeningToUnderlyingTelemetry();
|
||||
};
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user