Skip to content

Commit

Permalink
Clear link-call timeouts when node is closed
Browse files Browse the repository at this point in the history
Fixes #3959
  • Loading branch information
knolleary committed Mar 2, 2023
1 parent 010c8ec commit 5e9a815
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/node_modules/@node-red/nodes/core/common/60-link.js
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,14 @@ module.exports = function(RED) {
}
});

this.on("close", function () {
for (const event of Object.values(messageEvents)) {
if (event.ts) {
clearTimeout(event.ts)
}
}
})

this.returnLinkMessage = function(eventId, msg) {
if (Array.isArray(msg._linkSource) && msg._linkSource.length === 0) {
delete msg._linkSource;
Expand Down

0 comments on commit 5e9a815

Please sign in to comment.