Kirill, I am sure what you are asking. Remi's initial question was resolved to be due to calling print in a finalizer, and unrelated to the ccall usage (which works fine).
On Sat Feb 14 2015 at 5:19:00 PM Kirill Ignatiev <[email protected]> wrote: > On Saturday, 14 February 2015 08:22:57 UTC-5, Rémi Berson wrote: >> >> Wrap the returned pointer into another type and register a finalizer for >> it (and you must return it, otherwise it will be garbage collected >> immediately). > > > The problem still exists, this doesn't address it: how do I run a C > function in a finalizer? I cannot run the finalizer myself immediately, and > the object returned will live for an unknown amount of time. If the > finalizer needs to call a C function to free the object's internal state, > how do I assign such a finalizer to a Julia object? > >
