let's go with what nemo suggests
authorkoda
Sun, 14 Apr 2013 22:57:13 +0200
changeset 8911 f17e505ef30b
parent 8910 a60f7ebab219
child 8912 78ea1839aac9
let's go with what nemo suggests
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);