コード例 #1
0
ファイル: Bot.cs プロジェクト: HellBz/TS3AudioBot
        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;
            }
        }
コード例 #2
0
        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;
            }
        }