Tomasz Motyl wrote:
1. what if  there exist a nsIalTuner instance already (rather persistently)
and I wish I made it accessible for upper layers through for example
(simplyfying of course) : *aTuner = &my_tuner_instance; this instances shall
be destroyed while an object containing them is being destroyed.. mentioned
object is created seldom but persistantly - once per plugin load :)
I wish it was possible, but i'm not sure of some mechanisms ruling o'er a
mozilla's plugins..

The XPCOM rules for such out parameters are that you assign to *out_param and you addref it... if you want your object be destroyed while others still have a reference to it, idl-defined scriptable interfaces are not for you.


2. maybe it has a memory allocated under **aTuner and
**aTuner=my_tuner_instance is enough (I  SUPPOSE 'TIS NOT!! but i havn't
found anything about this in docs)..

Um, interfaces don't have a copy constructor; how do you expect this to work? As I said, you don't necessarily have to allocate memory separately, you can just assign an already existing object to *out_param and addref it.


3. Is it neccessary to call a CREATE_INSTANCE(...) macro while returning an
objects..

There is no such macro?


You can create the component in any way you want, needs not be via CreateInstance. It needs not be registered with the component manager at all. but you must make sure that you addref the object.
_______________________________________________
Mozilla-xpcom mailing list
[EMAIL PROTECTED]
http://mail.mozilla.org/listinfo/mozilla-xpcom

Reply via email to