mirror of
https://github.com/Threnklyn/MinecraftChat.git
synced 2026-06-07 13:43:31 +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() {
|
socket.on('disconnect', function() {
|
||||||
if (socket.mcbot) {
|
if (socket.mcbot) {
|
||||||
socket.mcbot.end();
|
socket.mcbot.end();
|
||||||
|
socket.mcbot = null;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -11,6 +12,7 @@ module.exports = function(socket) {
|
|||||||
socket.on('bot:disconnect', function() {
|
socket.on('bot:disconnect', function() {
|
||||||
if (socket.mcbot) {
|
if (socket.mcbot) {
|
||||||
socket.mcbot.end();
|
socket.mcbot.end();
|
||||||
|
socket.mcbot = null;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user