Commit 5a21d20b authored by simonmar's avatar simonmar
Browse files

[project @ 2000-04-14 12:49:39 by simonmar]

Free the spare buffers immediately we hClose a file handle.
parent 4d35ec65
......@@ -392,11 +392,16 @@ hClose handle =
is finalized. (we overwrite the file ptr in the underlying
FileObject with a NULL as part of closeFile())
if rc == (0::Int)
then return (handle_{ haType__ = ClosedHandle,
haFO__ = nullFile__ })
else constructErrorAndFail "hClose"
if (rc /= 0)
then constructErrorAndFail "hClose"
-- free the spare buffers (except the handle buffer)
-- associated with this handle.
else do freeBuffers (haBuffers__ handle_)
return (handle_{ haType__ = ClosedHandle,
haFO__ = nullFile__,
haBuffers__ = [] })
Computation $hClose hdl$ makes handle {\em hdl} closed. Before the
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment