On 11/3/09 4:05 PM, Georgios Petasis wrote:
Thank you very much for the tip. I tried to use nsCOMPtr, but I got compilation errors (GetDocument didn't accept a nsCOMPtr value), so I simulated what nsCOMPtr would have done. Maybe a getterAddRef is needed if I use a nsCOMPtr call?
Yes, exactly. nsCOMPTr<nsIDOMDocument> doc; mWebNavigation->GetDocument(getter_AddRefs(doc));
To say the truth, I didn't know that GetDocument kept a reference to the provided doc. Is there a list of methods that behave in a similar way?
All XPCOM methods. If it's declared in IDL and doesn't have the [notxpcom] annotation, it behaves this way. This is well-documented, I thought.
-Boris _______________________________________________ dev-embedding mailing list dev-embedding@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-embedding