c2hs icon indicating copy to clipboard operation
c2hs copied to clipboard

"pointer foreign finalizer fcide" not working

Open kolmodin opened this issue 8 years ago • 1 comments

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.

kolmodin avatar Oct 18 '16 19:10 kolmodin

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.

Magicloud avatar Dec 15 '18 08:12 Magicloud