From 07da18930a12e89c6211bcf287321e8fdf328be5 Mon Sep 17 00:00:00 2001 From: Roman Kassebaum Date: Sat, 21 May 2016 02:48:40 +0200 Subject: [PATCH] TDosThread without FreeOnTerminate doesn't seem to be threadsafe. --- Source/DosCommand.pas | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/DosCommand.pas b/Source/DosCommand.pas index 6b759f6..5e95d1e 100644 --- a/Source/DosCommand.pas +++ b/Source/DosCommand.pas @@ -569,6 +569,7 @@ constructor TDosThread.Create(AOwner: TDosCommand; ACl, ACurrDir: string; ALines FMaxTimeAfterLastOutput := AMtalo; FPriority := Ap; FTerminateEvent := TEvent.Create(nil, True, False, ''); + FreeOnTerminate := False; end; destructor TDosThread.Destroy; @@ -1163,7 +1164,6 @@ procedure TDosCommand.Stop; begin if (FThread <> nil) then begin - FThread.FreeOnTerminate := False; FThread.Terminate; // by sirius FThread.WaitFor; // by sirius2 FreeAndNil(FThread);