Destroy classes and unsubscribe when condition set view is destroyed

This commit is contained in:
Joshi 2020-01-26 22:21:06 -08:00
parent 0beda1d053
commit d98b54bea7

View File

@ -40,6 +40,12 @@ export default {
condition: this.condition
};
},
destroyed() {
this.conditionClass.off('conditionResultUpdated', this.handleConditionResult.bind(this));
if (this.conditionClass && typeof this.conditionClass.destroy === 'function') {
this.conditionClass.destroy();
}
},
mounted() {
this.openmct.objects.get(this.conditionIdentifier).then((obj => {
this.condition = obj;