I have a question about how GC works in DLLs with callbacks. Let's say I have a BlitzMax-written DLL and a C/C++-written main program calling the DLL. I pass a C function to the DLL as a callback to use during a certain task. The main program looks like this:
The DLL looks like this:
Is there something I need to do with the GC when the callback gets used? Like GCSuspend/Resume, or GCLeave/Enter? What is the correct way of handling this? Thanks.
int callback { Return 1; } MyFunction(callback);
The DLL looks like this:
Function MyFunction( callback:Int() ) "win32" GCEnter() 'GC-What goes here? callback() 'GC-What goes here? EndFunction
Is there something I need to do with the GC when the callback gets used? Like GCSuspend/Resume, or GCLeave/Enter? What is the correct way of handling this? Thanks.