c2hs
c2hs copied to clipboard
"pointer foreign finalizer fcide" not working
Using
C->Haskell Interface Version C->Haskell Compiler, version 0.28.1 Switcheroo, 1 April 2016
I'm defining a pointer
data CChannel
{#pointer *channel as Channel foreign finalizer channel_destroy -> CChannel#}
However, the finalizer is only added in {#fun#}
declarations in the same file. Fun declarations in other files don't get the finalizer.
The .chi
file doesn't mention the finalizer function.
I have the same question. I thought the finalizer would be used in default out marshaller. But it is just newForeignPtr_
. Unless GHC would call the finalizer itself, I think there is something wrong and has this function correctly working.