Weak references.

Frits van Bommel fvbommel at REMwOVExCAPSs.nl
Sun Apr 13 04:17:00 PDT 2008


Jarrett Billingsley wrote:
> To both: yes, that's what I would have expected, but I can't seem to get the 
> object to be collected even if the only reference to it is a weak reference. 
> Tried forcing a full collect, allocating bunches of memory, collecting 
> again, allocating at the beginning of a long-running program etc.  it never 
> seems to get collected, even if I never assign the reference into an actual 
> pointer type.
> 
> I'm using Tango if it makes any difference. 

Have you tried looking at the generated assembler code? Perhaps the 
compiler is leaving a reference in some register that's never 
overwritten afterwards or something...



More information about the Digitalmars-d mailing list