mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Remove all input event listeners on a node once it is closed
This prevents in-flight messages being passed to the node after it has closed.
This commit is contained in:
parent
c47b553a8e
commit
001f066769
@ -338,12 +338,14 @@ Node.prototype.close = function(removed) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (promises.length > 0) {
|
if (promises.length > 0) {
|
||||||
return Promise.all(promises).then(function() {
|
return Promise.all(promises).then(() => {
|
||||||
|
this.removeAllListeners("input")
|
||||||
if (this._context) {
|
if (this._context) {
|
||||||
return context.delete(this._alias||this.id,this.z);
|
return context.delete(this._alias||this.id,this.z);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
this.removeAllListeners("input")
|
||||||
if (this._context) {
|
if (this._context) {
|
||||||
return context.delete(this._alias||this.id,this.z);
|
return context.delete(this._alias||this.id,this.z);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user