Skip to content

Commit 07da189

Browse files
author
Roman Kassebaum
committed
TDosThread without FreeOnTerminate doesn't seem to be threadsafe.
1 parent 20491d3 commit 07da189

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Source/DosCommand.pas

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -569,6 +569,7 @@ constructor TDosThread.Create(AOwner: TDosCommand; ACl, ACurrDir: string; ALines
569569
FMaxTimeAfterLastOutput := AMtalo;
570570
FPriority := Ap;
571571
FTerminateEvent := TEvent.Create(nil, True, False, '');
572+
FreeOnTerminate := False;
572573
end;
573574

574575
destructor TDosThread.Destroy;
@@ -1163,7 +1164,6 @@ procedure TDosCommand.Stop;
11631164
begin
11641165
if (FThread <> nil) then
11651166
begin
1166-
FThread.FreeOnTerminate := False;
11671167
FThread.Terminate; // by sirius
11681168
FThread.WaitFor; // by sirius2
11691169
FreeAndNil(FThread);

0 commit comments

Comments
 (0)