mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00: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) {
|
||||
return Promise.all(promises).then(function() {
|
||||
return Promise.all(promises).then(() => {
|
||||
this.removeAllListeners("input")
|
||||
if (this._context) {
|
||||
return context.delete(this._alias||this.id,this.z);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.removeAllListeners("input")
|
||||
if (this._context) {
|
||||
return context.delete(this._alias||this.id,this.z);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user