Destroy socket on disconnect to prevent dangling sockets

This commit is contained in:
calzoneman 2013-04-11 11:23:45 -05:00
parent 3f2095b14e
commit 0b1a27a131
1 changed files with 1 additions and 0 deletions

View File

@ -317,6 +317,7 @@ Channel.prototype.userLeave = function(user) {
// Their socket might already be dead, so wrap in a try-catch // Their socket might already be dead, so wrap in a try-catch
try { try {
user.socket.leave(this.name); user.socket.leave(this.name);
user.socket.destroy();
} }
catch(e) {} catch(e) {}