Re: question on nsIWeakReference

John Bandhauer <[email protected]> Sun, 05 Jan 2003 11:36:49 -0800
Newsgroups gmane.comp.mozilla.devel.java,gmane.comp.mozilla.devel.xpcom,gmane.comp.mozilla.devel.embedding
Organization Another Netscape Collabra Server User
Message-ID <[email protected]>
[setting follow-ups to netscape.public.mozilla.xpcom]

Did you read the fine manual?

http://www.mozilla.org/projects/xpcom/weak_references.html

Note that the code got moved to...

http://lxr.mozilla.org/seamonkey/source/xpcom/glue/

..and the lxr urls in the doc *ought* to get updated.

John.

jml wrote:
> I have some question on nsIWeakReference and nsISupportsWeakReference.
> 
> 1. How error code should nsIWeakReference.queryReferent() return if the 
> corresponding xpcom object is disposed?

http://lxr.mozilla.org/seamonkey/source/xpcom/glue/nsWeakReference.cpp#149

> 
> 2. For the whole design, why require the nsISupportsWeakReference 
> interface? I don't see the necessary of the nsISupportsWeakReference 
> interface, at least, if one can provide an nsIWeakReference, why care 
> about nsISupportsWeakReference?
> 
> 3. BTW, it is very easy to implement the nsIWeakReference in java, only 
> need to use the java weakreference support. Can anyone explain how 
> weakreference works in the C/C++ world? I noticed there are a lot of 
> C/C++ macro for it, hard to understand for me :-)
> 
> Thanks
> 
> jml
> 
>