Advice wanted on garbage collection of sockets for c++ programmer using D

Mike Parker via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed Jun 28 07:17:52 PDT 2017


On Wednesday, 28 June 2017 at 13:19:37 UTC, Guillaume Piolat 
wrote:

> https://forum.dlang.org/post/pmulowxpikjjffkrscct@forum.dlang.org
>
> Not an issue with DerelictUtil, an issue with the strategy of 
> closing resources in GC with this case.
>
> Derelict loaders work-around this by not unloading shared 
> libraries so the GC won't unload shared libs before the 
> resources related to the shared library are freed.
>
> https://github.com/DerelictOrg/DerelictAL/blob/master/source/derelict/openal/dynload.d#L366

Yeah, the loaders all used to needlessly unload the shared 
libraries in a static destructor. The fact that they don't 
anymore isn't to avoid any GC/destructor issues, but because 
there's no point in unloading the libraries when the system is 
going to do it anyway.


More information about the Digitalmars-d-learn mailing list