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