Excerpts from Axel Simon's message of Tue Jul 13 16:03:01 -0400 2010: > If your C code has a way to properly unref a pointer then you could > wrap your ForeignPtr in a StablePtr and pass that to C land. Once C > has freed the StablePtr the ForeignPtr can become dead when Haskell > has dropped all references and it will be garbage collected.
Does ForeignPtr have a guaranteed representation from C land? I feel like you want to create a stable pointer and then unsafely cast the foreign pointer into a real pointer, which would effectively fizzle the original foreign pointer's finalizer. Cheers, Edward _______________________________________________ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users