From: simonmar Date: Mon, 25 Oct 2004 13:40:08 +0000 (+0000) Subject: [project @ 2004-10-25 13:40:08 by simonmar] X-Git-Tag: nhc98-1-18-release~209 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=24b6429c53ce9f632963c9a8102d73afe35a50df;p=ghc-base.git [project @ 2004-10-25 13:40:08 by simonmar] Doc update: notes on finalization of Handles --- diff --git a/GHC/IOBase.lhs b/GHC/IOBase.lhs index 07273f9..8700128 100644 --- a/GHC/IOBase.lhs +++ b/GHC/IOBase.lhs @@ -266,6 +266,15 @@ instance Eq (MVar a) where -- enough information to identify the handle for debugging. A handle is -- equal according to '==' only to itself; no attempt -- is made to compare the internal state of different handles for equality. +-- +-- GHC note: a 'Handle' will be automatically closed when the garbage +-- collector detects that it has become unreferenced by the program. +-- However, relying on this behaviour is not generally recommended: +-- the garbage collector is unpredictable. If possible, use explicit +-- an explicit 'hClose' to close 'Handle's when they are no longer +-- required. GHC does not currently attempt to free up file +-- descriptors when they have run out, it is your responsibility to +-- ensure that this doesn't happen. data Handle = FileHandle -- A normal handle to a file