Search completed in 1.28 seconds.
13 results for "NS_RELEASE":
NS_RELEASE
MozillaTechXPCOMReferenceNS RELEASE
ns_release(foo) is equal to foo->release(); foo = 0; syntax ns_release(foo); see also ns_addref, ns_if_release ...
Modularization techniques - Archive of obsolete content
ArchiveMozillaModularization Techniques
the convenience macros ns_addref() and ns_release() are preferred over calling addref and release directly.
... #include "nsisample.h" #include "nssample.h" static ns_define_iid(kisampleiid, ns_isample_iid); int main(int argc, char *argv[]) { nsifactory *factory; getsamplefactory(&factory); nsisample *sample; nsresult res = factory->createinstance(null, kisampleiid, (void **) &sample); if (res == ns_ok) { sample->hello(); ns_release(sample); } return 0; } moving to a dynamically linked library implementing a dll once you've set a factory, moving it to a dll is a relatively trivial thing.
...ple_iid); static ns_define_cid(ksamplecid, ns_sample_cid); int main(int argc, char *argv[]) { nsisample *sample; nsresult res = nsrepository::createinstance(ksamplecid, null, kisampleiid, (void **) &sample); if (res == ns_ok) { sample->hello(); ns_release(sample); } return 0; } registering a dll this is currently being hashed out.
...And 2 more matches
Reference Manual
MozillaTechXPCOMUsing nsCOMPtrReference Manual
nscomptr<nsifoo> foo = ...; foo->addref(); // error: |addref| is private delete foo.get(); // error: |operator delete| is private ns_release(foo); // error: |release| is private of course, the most important safety feature provided by nscomptr is that it addrefs and releases automatically at the appropriate times.
... ns_release(p); p->getnext(&p); // trouble!
...in fact, if you used the ns_release macro, p would be null by the time you got to the getnext call.
... // introduce a temporary so we // don't stomp on |p| nsidomnode* temp = p; temp->getnext(&p); ns_release(temp); } // safe iterating with |nscomptr|...
nsISupports proxies
MozillaTechXPCOMReferenceInterfacensISupports proxies
when you are finished with a proxy object, you should call ns_release on it.
...ns_release(ptestobj); pproxy->bar(); ns_release(pproxy); original document information author: doug turner last updated date: january 27, 2007 copyright information: portions of this content are © 1998–2007 by individual mozilla.org contributors; content available under a creative commons license | details.
NS_ADDREF
MozillaTechXPCOMReferenceNS ADDREF
ns_addref(foo) is equivalent to foo->addref(); this macro exists mainly for historical reasons, but for consistency and for symmetry with ns_release it should still be used.
... syntax ns_addref(foo); see also ns_if_addref ns_release ...
NS_IF_RELEASE
MozillaTechXPCOMReferenceNS IF RELEASE
this macro should only be used when the pointer might be null; otherwise, use ns_release.
... ns_if_release is exactly equivalent to the following function: inline void ns_if_release(nsisupports* foo) { if (foo) foo->release(); foo = 0; } syntax ns_if_release(foo); see also ns_addref, ns_release ...
RDF Datasource How-To - Archive of obsolete content
ArchiveMozillaRDF Datasource How-To
ns_release(mydatasource); } nsservicemanager::releaseservice(krdfservicecid, rdf); } displaying rdf as content now that you've gone through all this pain to expose your information as a datasource, you probably want to see it.
IPDL Tutorial
MozillaIPDLTutorial
}; virtual pexamplechild* toplevelchild::allocpexample() { refptr<examplechild*> actor = new examplechild(); return actor.forget(); } virtual bool toplevelchild::deallocpexample(pexamplechild* actor) { ns_release(static_cast<examplechild*>(actor)); return true; } if an object that implements a protocol can't be constructed inside allocpfoo, has been previously constructed and doesn't require an ipdl connection throughout its lifetime, or implements a refcounted protocol where the first form of constructor is not available, there is a second form of sendpfooconstructor which can be used: class example...
An Overview of XPCOM
MozillaTechXPCOMGuideCreating componentsAn Overview of XPCOM
ns_release calls release on an nsisupports object.
Finishing the Component
MozillaTechXPCOMGuideCreating componentsFinishing the Component
* when they are finished they can ns_release() the service as usual.
Using XPCOM Utilities to Make Things Easier
MozillaTechXPCOMGuideCreating componentsUsing XPCOM Utilities to Make Things Easier
ns_release(value); // release our reference } a method returns an nsisupports interface pointer that has been reference counted before it is returned (assuming it wasn't nsnull).
Index
MozillaTechXPCOMIndex
148 ns_if_addref xpcom, xpcom_macros macro 149 ns_if_release xpcom, xpcom_macros macro 150 ns_release xpcom, xpcom_macros macro 151 ns_warning xpcom, xpcom_macros macro 152 standard xpcom components components, landing, mozilla, needscontent, xpcom there are a number of components provided in the standard implementation of xpcom; these are as follows.
XPCOM reference
MozillaTechXPCOMReference
this macro is meant for critical errors; like assertions, ns_errors should not be reachable.ns_if_addrefmacrons_if_releasemacrons_releasemacrons_warningmacronsgetmoduleprocthis function prototype provides the xpcom entry-point into a module.nsiabcard/thunderbird3the nsiabcard interface is used to represent and manipulate cards in the address book.