A WeakReference is just a way of holding a reference to an object that will not keep it from being garbage collected (a very useful thing). There are also ways that you can track when it has been garbage collected. Once it has been garbage collected, it's gone though. All you have is any data you originally associated with your WeakReference (by subclassing or some other method). You cannot access the referenced object anymore because it doesn't exist.

While the object still exists (ie: is strongly referenced some where), you can still access it through the WeakReference. You just have to expect that at some point you may go to retrieve it from the WeakReference and get a null.

Maybe it would help to know what you are trying to do with it. There are other Reference implementations that may be better suited.

-Paul

Dakota Jack wrote:

Working here on a "new" paradigm, sort of, I think.

Apparently you can track what has happened to a strong reference with
a weak reference but you cannot manipulate the object referred to by
the strong reference by manipulating the weak reference.  Is that
right?  Seems odd to me.

Jack




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to