Review of std.signal

Martin Nowak code at dawg.eu
Thu Jan 23 14:58:08 PST 2014


On 01/13/2014 10:16 PM, ilya-stromberg wrote:
>
> It's not so good to have array of delegates because you will have a
> memory leaks. Delegate has permanent pointer to the object, so GC will
> never free it. As alternative, you can delete delegate manually, but in
> this case you can have problems with manual memory management.
>
> So, array of delegates is possible solution, but only for VERY simple
> cases. This module solves problem with memory leaks because it
> implements weak connections (based on weak reference). It's easy to use,
> but VERY difficult to implement.

But weak references should be implemented on GC/druntime level.


More information about the Digitalmars-d mailing list