X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=server%2Firc%2Fconnection.js;h=ce24ece4a75d54eb8fd2c98286e887ab4705229c;hb=bf6d219be77fc4427f76e0b223f8c5b84d28ad00;hp=311c811b1965bbed6643ca44484d2acd282b99eb;hpb=9be602fc8bc7d4f78fd8c48ce781b0671f64d98d;p=KiwiIRC.git diff --git a/server/irc/connection.js b/server/irc/connection.js index 311c811..ce24ece 100644 --- a/server/irc/connection.js +++ b/server/irc/connection.js @@ -186,8 +186,11 @@ IrcConnection.prototype.dispose = function () { _.each(this.irc_channels, function (chan) { chan.dispose(); }); - this.irc_users = null; - this.irc_channels = null; + this.irc_users = undefined; + this.irc_channels = undefined; + + this.server.dispose(); + this.server = undefined; EventBinder.unbindIrcEvents('', this.irc_events, this); @@ -202,6 +205,7 @@ IrcConnection.prototype.dispose = function () { */ IrcConnection.prototype.disposeSocket = function () { if (this.socket) { + this.socket.end(); this.socket.removeAllListeners(); this.socket = null; }