Search completed in 1.28 seconds.
5 results for "Dont_AddRef":
Reference Manual
MozillaTechXPCOMUsing nsCOMPtrReference Manual
the nscomptr releases its old value, if any, and then assigns in the new value, addrefing it and/or calling queryinterface as you direct by "annotating" the assignment with directives like dont_addref.
...you can construct an nscomptr from, or assign into it any of the following the value 0 another nscomptr of the same type a raw xpcom interface pointer of the same type a raw xpcom interface pointer of the same type, annotated with the dont_queryinterface directive a raw xpcom interface pointer of the same type, annotated with the dont_addref directive or a synonym any interface pointer (either nscomptr or a raw xpcom interface pointer) of any type, annotated with the do_queryinterface directive a do_queryreferent directive the first three of these are simple and obvious.
... don't qi qi addref t*, dont_queryinterface(t*) do_queryinterface(nsisupports*), do_queryinterface(nsisupports*, nsresult*) do_queryreferent(nsiweakreference*), do_queryreferent(nsiweakreference*, nsresult*) don't addref dont_addref(t*), getter_addrefs(t*) n/a e.g., one of the possibilities for assigning into an nscomptr, but you don't want to addref the pointer you are assigning (because it has already been addrefed for some reason) is dont_addref(t*) found at the intersection of "don't addref" and "don't qi".
...And 10 more matches
Getting Started Guide
MozillaTechXPCOMUsing nsCOMPtrGetting Started Guide
dont_addref is a similar directive that helps you when you assign in a pointer that has already been addrefed, e.g., because you called a getter that returned the pointer as its function result.
... using dont_addref.
... nscomptr<nsifoo> foo(dont_addref(createfoo())); // |createfoo| |addref|s its result, as all good getters do something nscomptr doesn't do an nscomptr does all that is necessary to behave as an owning reference.
...And 3 more matches
Extending a Protocol
MozillaIPDLExtending a Protocol
d let's implement: allocpechoparent() deallocpechoparent(pechoparent* aactor) so, let's add: already_addrefed<echoparent> windowglobalparent::allocpechoparent() { puts("windowglobalparent::allocpechoparent was called"); refptr<echoparent> actor = new echoparent(); return actor.forget(); } bool windowglobalparent::deallocpechoparent( pechoparent* aactor) { refptr actor = dont_addref(static_cast(aactor)); return true; } the "puts()" there will help us see what's going on once we get things going.
Leak-hunting strategies and tips
MozillaPerformanceLeak-hunting strategies and tips
double-addref: this happens most often when assigning the result of a function that returns an addrefed pointer (bad!) into an nscomptr without using dont_addref().
already_AddRefed
MozillaTechXPCOMalready AddRefed
nscomptr<nsifoo> foo = getfoo(); see also nscomptr, getteraddrefs(), dont_addref().