mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2025-03-09 15:40:18 +00:00
Fix for #2498
This commit is contained in:
parent
775457e2b9
commit
112298cf84
2 changed files with 7 additions and 2 deletions
|
@ -471,7 +471,12 @@ var CreateWsmanComm = function (host, port, user, pass, tls, tlsoptions, mpsConn
|
|||
|
||||
obj.destroy = function () {
|
||||
if (obj.socket != null) {
|
||||
if (obj.socket.removeAllListeners) { obj.socket.removeAllListeners(); }
|
||||
if (obj.socket.removeAllListeners) {
|
||||
// Do not remove the error handler since it may still get triggered.
|
||||
obj.socket.removeAllListeners('data');
|
||||
obj.socket.removeAllListeners('close');
|
||||
obj.socket.removeAllListeners('timeout');
|
||||
}
|
||||
try {
|
||||
if (obj.mpsConnection == null) {
|
||||
obj.socket.destroy();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue