DLLs: Cleaning up

dnewbie run3 at myopera.com
Thu Jul 11 12:37:30 PDT 2013


On Thursday, 11 July 2013 at 12:58:42 UTC, Chris wrote:
> I have a DLL written in D I load into a Python application via 
> ctypes like so:
>
> lib = CDLL("mydll")
>
> The DLL loads and can be used no problem. However, once the DLL 
> is discarded of by the program, the program either doesn't 
> react or crashes. I still haven't worked out how to clean up 
> the DLL correctly before it is unloaded / detached (from 
> Python). I guess it's the GC and/or some C stuff I've 
> overlooked. I have tried both approaches described on this 
> page: http://dlang.org/dll.html.
>
> Maybe someone of yous once had a similar problem and found a 
> solution. Any hints or suggestions would be appreciated. Thanks.

Ye. Please try compiling your DLL with GDC.


More information about the Digitalmars-d-learn mailing list