We're looking for a user researcher to understand the needs of developers and designers. Is this you or someone you know? Check out the post: https://mzl.la/2IGzdXS


« XPCOM API Reference


Inherit from this C++ class to add canonical support for nsISupportsWeakReference.

See Weak reference for detailed description of weak references.

#include "nsWeakReference.h"

class nsSupportsWeakReference { ... };


In addition to inheriting from this class, you will need to ensure that your nsISupports::QueryInterface implementation exposes nsISupportsWeakReference as a supported interface.

To use this class, you must link your component or application against the XPCOM Glue library.

Example code

 // Supporting weak references to a hypothetical implementation
 // of the nsIFoo interface...

 #include "nsWeakReference.h"
 #include "nsIFoo.h"

 class MyFoo : public nsIFoo, public nsSupportsWeakReference


 NS_IMPL_ISUPPORTS2(MyFoo, nsIFoo, nsISupportsWeakReference)


See also

nsISupports::QueryInterface , nsISupportsWeakReference

Document Tags and Contributors

Contributors to this page: Sheppy, gsvelto, Nickolay, Pmash
Last updated by: Sheppy,