Closed vrotaru closed 1 year ago
Is that something expected?
It's expected (though not guaranteed) if the closure passed to C is garbage collected before it's called from the C side. It should be possible to avoid the problem by keeping a reference of some kind to the closure in OCaml, but the details will depend on your library or application.
Thanks, for the reply. I'll try to check it by forcing a garbage collection.
Hi, I'm currently playing with a proof-of-concept Gtk4 bindings and I've run into this issue
CallToExpiredClosure
exception being thrown. It happens when I let window open a rather long time, and here is the closureWhere
<~>
is just a shortcut forsignal_connect
and(fun _ ...)
is the callback. Is that something expected? Now that I think of it probably yes, sincebuffer
is local to the method were this is called. Is that the case?