Skip to content

Commit

Permalink
sys/files(posix): unregister fd for AsyncFileImpl
Browse files Browse the repository at this point in the history
cleanupFile is used in both `AsyncFile`-based APIs and `AsyncFileImpl` hooks,
so it needs to be aware of both
  • Loading branch information
alaviss committed Jan 16, 2021
1 parent 7cec51c commit a51a859
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/sys/private/files_posix.nim
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ type
handle: Handle[FD]

template cleanupFile(f: untyped) =
when f is AsyncFile:
when f is AsyncFileImpl or f is AsyncFile:
# XXX: `!=` doesn't work here, probably a compiler bug
if not (f.handle.get == InvalidFD):
unregister AsyncFD f.handle.get
Expand Down

0 comments on commit a51a859

Please sign in to comment.