logo       

Another finalizer question: msg#00028

lang.haskell.glasgow.bugs

Subject: Another finalizer question

The library docs say

***
newForeignPtr :: ...

...Note that there is no guarantee on how soon the finalizer is executed after
the last reference was dropped; this depends on the details of the Haskell
storage manager. The only guarantee is that the finalizer runs before the
program terminates.
***

As others have noted too, there is in fact *no* guarantee that finalizers are
called. The only way I found to force calling of finalizers is explicitly
calling System.Mem.performGC before the program exits.

Is this a bug in the implementation of finalizers or is the documentation
wrong or am I just stupid?

Ben
--
Top level things with identity are evil. -- Lennart Augustsson


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise