Hi
I'm wondering if we can add a generic way to pass the fact that a foreign value shouldn't be released. I'm encountering a crash on a function that returns a pointer to a static string. At the moment it seems doimport just has a hard coded true for release.
Cheers
Monte
avoiding releasing foreign types
avoiding releasing foreign types
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/
Re: avoiding releasing foreign types
@monte: At the moment the FFI interface has no idea of 'give, borrow or take' - in this instance you want to 'borrow' the value from the native function. Unfortunately, the only way to do this at the moment is to return a Pointer, and then use MCStringCreateWithCString directly as a foreign binding.
Re: avoiding releasing foreign types
OK, I was thinking it might be possible to add some syntax to the foreign handler definitions to declare ownership or at least whether it should be freed.
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/