Set bot to null on end. This allows the object to be garbage collected

This commit is contained in:
AlexKvazos
2015-04-28 17:31:08 -05:00
parent 9c0fc1a537
commit 99c4fb8e64
@@ -4,6 +4,7 @@ module.exports = function(socket) {
socket.on('disconnect', function() {
if (socket.mcbot) {
socket.mcbot.end();
socket.mcbot = null;
}
});
@@ -11,6 +12,7 @@ module.exports = function(socket) {
socket.on('bot:disconnect', function() {
if (socket.mcbot) {
socket.mcbot.end();
socket.mcbot = null;
}
});