mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-17 17:29:21 +02:00
* Patch from Martin to set FCloseHandleOnExecute before invoking OnGetHandle - the handler might change it
This commit is contained in:
parent
8c8b336914
commit
299c90b91d
@ -1180,6 +1180,7 @@ begin
|
|||||||
begin
|
begin
|
||||||
FTheirHandleIOType := IOType;
|
FTheirHandleIOType := IOType;
|
||||||
FOurHandle:=THAndle(INVALID_HANDLE_VALUE);
|
FOurHandle:=THAndle(INVALID_HANDLE_VALUE);
|
||||||
|
FCloseHandleOnExecute:=(IOType<>iotDefault);
|
||||||
Case IOType of
|
Case IOType of
|
||||||
iotDefault : H:=CreateStandardHandle;
|
iotDefault : H:=CreateStandardHandle;
|
||||||
iotPipe : H:=CreatePipeHandle;
|
iotPipe : H:=CreatePipeHandle;
|
||||||
@ -1188,7 +1189,6 @@ begin
|
|||||||
iotHandle : H:=CreateCustomHandle;
|
iotHandle : H:=CreateCustomHandle;
|
||||||
iotNull : H:=CreateNullFileHandle;
|
iotNull : H:=CreateNullFileHandle;
|
||||||
end;
|
end;
|
||||||
FCloseHandleOnExecute:=(IOType<>iotDefault);
|
|
||||||
FTheirHandle:=PrepareCreatedHandleForProcess(H);
|
FTheirHandle:=PrepareCreatedHandleForProcess(H);
|
||||||
if Assigned(FAfterAllocateHandle) then
|
if Assigned(FAfterAllocateHandle) then
|
||||||
FAfterAllocateHandle(Self,FTheirHandle,FCloseHandleOnExecute);
|
FAfterAllocateHandle(Self,FTheirHandle,FCloseHandleOnExecute);
|
||||||
|
Loading…
Reference in New Issue
Block a user