mirror of
https://github.com/Threnklyn/MinecraftChat.git
synced 2026-05-18 20:33:28 +02:00
Set bot to null on end. This allows the object to be garbage collected
This commit is contained in:
@@ -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;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user