Is there any plans to make working signals in D?

Kapps opantm2+spam at gmail.com
Sun Apr 14 14:30:32 PDT 2013


On Sunday, 14 April 2013 at 17:35:00 UTC, Johannes Pfau wrote:
> IMHO if a object still is connected to a active signal it 
> should not be
> collected. So the place where the signal stores the handler 
> should be
> scanned by the GC as usual. Then just document clearly that you 
> have to
> remove a handler to make sure that garbage collection can 
> really kick
> in.

The caller should have the option to connect a strong reference 
or a weak reference. In C#, people forgetting to disconnect event 
handlers is the most common source of memory leaks. Let's not 
bring that to D.


More information about the Digitalmars-d mailing list