DLLs: Cleaning up

Chris wendlec at tcd.ie
Thu Jul 11 05:58:39 PDT 2013


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.


More information about the Digitalmars-d-learn mailing list