mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-08 09:26:11 +02:00
* Prevent file descriptor leaks
This commit is contained in:
parent
09be1dfee1
commit
409abb8a43
@ -1069,7 +1069,10 @@ begin
|
||||
H:=ResolveProcessHandle;
|
||||
// Writeln(StdErr,GetProcessID,' : ',ProcessHandleType,' closing their handle ',IOType,': ',H);
|
||||
if H<>THandle(INVALID_HANDLE_VALUE) then
|
||||
begin
|
||||
FileClose(H);
|
||||
FTheirHandle:=THandle(INVALID_HANDLE_VALUE);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TIODescriptor.PrepareHandles;
|
||||
@ -1133,6 +1136,7 @@ end;
|
||||
destructor TIODescriptor.Destroy;
|
||||
begin
|
||||
FreeAndNil(FStream);
|
||||
ResetHandles;
|
||||
inherited Destroy;
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user