Make some proper closes.

This commit is contained in:
cheatfate 2016-06-09 07:07:43 +03:00
commit fb4ff86ad6
2 changed files with 2 additions and 1 deletions

View file

@ -316,6 +316,7 @@ proc write*(f: AsyncFile, data: string): Future[void] =
proc close*(f: AsyncFile) =
## Closes the file specified.
unregister(f.fd)
when defined(windows) or defined(nimdoc):
if not closeHandle(f.fd.Handle).bool:
raiseOSError(osLastError())