# HG changeset patch # User koda # Date 1365973033 -7200 # Node ID f17e505ef30b80e43960fc312e9247cd6f417dad # Parent a60f7ebab219b92e5df7efa08c58153463bdf7ad let's go with what nemo suggests diff -r a60f7ebab219 -r f17e505ef30b hedgewars/uAI.pas --- a/hedgewars/uAI.pas Mon Apr 15 00:04:13 2013 +0400 +++ b/hedgewars/uAI.pas Sun Apr 14 22:57:13 2013 +0200 @@ -43,9 +43,12 @@ procedure FreeActionsList; begin AddFileLog('FreeActionsList called'); + if (ThinkThread <> nil) then + begin + StopThinking:= true; + SDL_WaitThread(ThinkThread, nil); + end; SDL_LockMutex(ThreadLock); - if (ThinkThread <> nil) then - SDL_KillThread(ThinkThread); ThinkThread:= nil; SDL_UnlockMutex(ThreadLock);