Steven Katz wrote:

> I'm not sure why calling the Constructor from the Create code should be odd.
> Isn't that what the Create funtion is for?


Sorry, I should have been more clear - in one of the code snippets it
looked as though it was calling CreateInstance() if-and-only-if the
QI() call failed. That is what *seemed* odd to *me* - FWIF - or maybe
just something clever.

<code>
if(f != NULL) {
   rv = f->QueryInterface(aIID,aInstancePtr);
   if(NS_FAILED(rv)) {
     rv = f->CreateInstance(outer,aIID,aInstancePtr);
   }
}
</code>

 > In other words, Mozilla would call Create when it wanted a
 > Factory AND it would call Create when it wanted a plugin
 > instance.  I didn't expect it to work this way, but that is
 > what happens on UNIX.

I think the factory object helps track the number of references
to the shared library/dll to help determine whether it is safe to
unload it from memory.

Anyways, pondering the latest info further.

-rick



Reply via email to