remove listener on destroy

This commit is contained in:
David Tsay 2020-03-19 20:30:27 -07:00
parent 3b82fd5d8b
commit ecf3e19f16

View File

@ -277,6 +277,7 @@ export default class ConditionClass extends EventEmitter {
}
destroy() {
this.conditionManager.off('broadcastTelemetry', this.handleBroadcastTelemetry, this);
if (typeof this.stopObservingForChanges === 'function') {
this.stopObservingForChanges();
}