public void Dispose() { BotManager.RemoveBot(this); lock (SyncRoot) { if (!IsDisposed) { IsDisposed = true; } else { return; } Log.Info("Bot ({0}) disconnecting.", Id); PluginManager.StopPlugins(this); PlayManager.Stop(); PlayManager = null; PlayerConnection.Dispose(); PlayerConnection = null; ClientConnection.Dispose(); ClientConnection = null; } }
public void Dispose() { BotManager.RemoveBot(this); lock (SyncRoot) { if (!IsDisposed) { IsDisposed = true; } else { return; } Log.Info("Bot disconnecting."); PluginManager.StopPlugins(this); PlayManager.Stop(); PlayManager = null; PlayerConnection.Dispose(); // before: logStream, PlayerConnection = null; QueryConnection.Dispose(); // before: logStream, QueryConnection = null; } }
public void Dispose() { Log.Info("TS3AudioBot shutting down."); Bots?.Dispose(); Bots = null; PluginManager?.Dispose(); // before: SessionManager, logStream, PluginManager = null; WebManager?.Dispose(); // before: logStream, WebManager = null; Database?.Dispose(); // before: logStream, Database = null; FactoryManager?.Dispose(); // before: FactoryManager = null; TickPool.Close(); }