Преглед на файлове

* don't destroy fsem in tthread.destroy before its potential last use

git-svn-id: trunk@5678 -
Jonas Maebe преди 18 години
родител
ревизия
cf4b3f2e4d
променени са 1 файла, в които са добавени 2 реда и са изтрити 1 реда
  1. 2 1
      rtl/unix/tthread.inc

+ 2 - 1
rtl/unix/tthread.inc

@@ -162,10 +162,10 @@ begin
       inherited destroy;
       exit;
     end;
-  CurrentTM.SemaphoreDestroy(FSem);
   if (FHandle = TThreadID(0)) then
   { another exception in constructor }
     begin
+      CurrentTM.SemaphoreDestroy(FSem);
       inherited destroy;
       exit;
     end;
@@ -181,6 +181,7 @@ begin
         Resume;
       WaitFor;
     end;
+  CurrentTM.SemaphoreDestroy(FSem);
   FFatalException.Free;
   FFatalException := nil;
   { threadvars have been released by cthreads.ThreadMain -> DoneThread }