Shutdown a bot's actions by making it check for disconnecting state rather than aborting the thread.

Aborting the thread appears to be causing shutdown issues.
0.7.6-extended
Justin Clark-Casey (justincc) 2013-08-14 19:21:07 +01:00
parent 3a62f39044
commit 97c514daa5
1 changed files with 3 additions and 3 deletions

View File

@ -158,7 +158,7 @@ namespace pCampBot
//add additional steps and/or things the bot should do
private void Action()
{
while (true)
while (ConnectionState != ConnectionState.Disconnecting)
lock (Behaviours)
Behaviours.ForEach(
b =>
@ -178,8 +178,8 @@ namespace pCampBot
{
ConnectionState = ConnectionState.Disconnecting;
if (m_actionThread != null)
m_actionThread.Abort();
// if (m_actionThread != null)
// m_actionThread.Abort();
Client.Network.Logout();
}