Hi,

Maybe you can achieve the effect you want by only putting weak references
to those objects in your collection.  Then, you could iterate over your
collection periodically looking for dead weak references and purge those
then.  Of course, you may have to have some sort of management appended to
the collection to make sure the objects are alive when you need them.
But, at least you won´t have to modify the contained objects at all.

   -T

> hi,
>
> i would like to count the strong references to an object. in my
> framework there is one collection which holds strong references to
> objects. i would like to remove those objects which have no foreign
> strong references. that means when i remove these objects they are
> garbage collected by the dotnet framework.
> i dont want to extend the objects with special functionalities to
> provide this information.
>
> thanks for your help!
> Christian

You can read messages from the Advanced DOTNET archive, unsubscribe from Advanced 
DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

Reply via email to