Number of references to a Class Object

d coder dlang.coder at gmail.com
Fri Feb 11 23:20:43 PST 2011


Greetings

I am in a situation where I need to know the number of references to a
class' object. To explain, I have an array of class objects and I
occasionally process this array. But if a particular object in this
array is not being garbage collected just because it is part of this
array, I would like to loose that object by making it null.

So either I need to find out the number of references to that object
and in case there is only one reference, I force the object null. If
this is not possible, I am sure there would be alternative solutions
since this should be a common situation faced by programmers.

Please help.

Regards
- Cherry


More information about the Digitalmars-d-learn mailing list