소스 검색

Fixed: Threads final execution app bug

PascalCoin 6 년 전
부모
커밋
1fadade763
1개의 변경된 파일9개의 추가작업 그리고 7개의 파일을 삭제
  1. 9 7
      src/core/UThread.pas

+ 9 - 7
src/core/UThread.pas

@@ -144,13 +144,15 @@ begin
       end;
       end;
     End;
     End;
   finally
   finally
-    l := _threads.LockList;
-    Try
-      i := l.Remove(Self);
-      {$IFDEF HIGHLOG}TLog.NewLog(ltdebug,Classname,'Finalizing Thread in pos '+inttostr(i+1)+'/'+inttostr(l.Count+1)+' working time: '+FormatFloat('0.000',TPlatform.GetElapsedMilliseconds(FStartTickCount) / 1000)+' sec');{$ENDIF}
-    Finally
-      _threads.UnlockList;
-    End;
+    if Assigned(_threads) then begin
+      l := _threads.LockList;
+      Try
+        i := l.Remove(Self);
+        {$IFDEF HIGHLOG}TLog.NewLog(ltdebug,Classname,'Finalizing Thread in pos '+inttostr(i+1)+'/'+inttostr(l.Count+1)+' working time: '+FormatFloat('0.000',TPlatform.GetElapsedMilliseconds(FStartTickCount) / 1000)+' sec');{$ENDIF}
+      Finally
+        _threads.UnlockList;
+      End;
+    end;
   end;
   end;
 end;
 end;