changeset 8911 | f17e505ef30b |
parent 8908 | d3033e3a4113 |
child 8938 | c321264439c6 |
--- 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);