signal slots library
Josh Stern
josh_usenet at phadd.net
Fri Oct 13 16:34:49 PDT 2006
On Fri, 13 Oct 2006 16:32:08 +0200, Bastiaan Veelo wrote:
>> To answer your question honestly I'm not exactly sure if unreferenced
>> objects get garbage collected, but if they get deleted they are safely
>> disconnected:
>
> OK, that is enough for C++ (Qt) style programming where the programmer
> has to take care of deletion. However, in D it would be really nice to
> let the garbage collector do that.
It seems like what is really needed is the ability to dynamically
associate some type of callback list with finalization of objects. If
there was a way to set a bit flag in the bookkeeping code for an object,
then the overhead of this when it is not used would be just checking
whether the flag is set. If it is, there would be an AA lookup on the
object address to get the callback list. Disconnecting signal/slot
bindings could be just one example of a callback. Another example where
this would be really useful is for mixing GC and non GC'd code.
More information about the Digitalmars-d-announce
mailing list