mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
parent
5179cc77f5
commit
c079576e49
@ -75,12 +75,14 @@ module.exports = function(RED) {
|
|||||||
// Workaround https://github.com/einaros/ws/pull/253
|
// Workaround https://github.com/einaros/ws/pull/253
|
||||||
// Remove listeners from RED.server
|
// Remove listeners from RED.server
|
||||||
var listener = null;
|
var listener = null;
|
||||||
for (var event = 0; event < node._serverListeners.length; event++) {
|
for(var event in node._serverListeners) {
|
||||||
|
if (node._serverListeners.hasOwnProperty(event)) {
|
||||||
listener = node._serverListeners[event];
|
listener = node._serverListeners[event];
|
||||||
if(typeof listener === "function"){
|
if(typeof listener === "function"){
|
||||||
RED.server.removeListener(event,listener);
|
RED.server.removeListener(event,listener);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
node._serverListeners = {};
|
node._serverListeners = {};
|
||||||
|
|
||||||
node.server.close();
|
node.server.close();
|
||||||
|
Loading…
Reference in New Issue
Block a user