Browse Source

* ffinish patch

git-svn-id: trunk@2141 -
marco 19 years ago
parent
commit
1318b959e0
1 changed files with 2 additions and 1 deletions
  1. 2 1
      rtl/linux/tthread.inc

+ 2 - 1
rtl/linux/tthread.inc

@@ -205,7 +205,8 @@ end;
 
 
 destructor TThread.Destroy;
 destructor TThread.Destroy;
 begin
 begin
-  if (FThreadID = GetCurrentThreadID) and not(FFreeOnTerminate) then
+  if (FThreadID = GetCurrentThreadID) and not(FFreeOnTerminate) 
+	and not fFinished then		
     raise EThreadDestroyCalled.Create('A thread cannot destroy itself except by setting FreeOnTerminate and leaving!');
     raise EThreadDestroyCalled.Create('A thread cannot destroy itself except by setting FreeOnTerminate and leaving!');
 
 
   // if someone calls .Free on a thread with
   // if someone calls .Free on a thread with