fix a critical bug in windows.osproc leading to resource leaks and blocking IO [backport] (#14296)
This commit is contained in:
parent
8018449319
commit
d11cb9d495
4 changed files with 36 additions and 1 deletions
|
|
@ -441,7 +441,11 @@ when defined(Windows) and not defined(useNimRtl):
|
|||
handle: Handle
|
||||
atTheEnd: bool
|
||||
|
||||
proc hsClose(s: Stream) = discard # nothing to do here
|
||||
proc hsClose(s: Stream) =
|
||||
# xxx here + elsewhere: check instead of discard; ignoring errors leads to
|
||||
# hard to track bugs
|
||||
discard FileHandleStream(s).handle.closeHandle
|
||||
|
||||
proc hsAtEnd(s: Stream): bool = return FileHandleStream(s).atTheEnd
|
||||
|
||||
proc hsReadData(s: Stream, buffer: pointer, bufLen: int): int =
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue