[EMAIL PROTECTED] wrote:
>
> Hi,
>
> I'm trying to create an instance of a xpcom copmponent (written in c++) in
>javascript. Now all goes well (in the xpcshell) untill the moment i call a method
>which looks like (in the idl file):
>
> void getResults(in long id, out string results);
>
> It core dumps, and I am wondering why?
>
> The method in my implementation looks something like:
>
> NS_IMETHODIMP MyClass::getResults(PRInt32 nr, char **results)
> {
> // Implementation.
> }
> The method works perfectly well when i'm using a C client. It core dumps when i'm
>using javascript client.
>
> Has anyone got ideas on this?
>
> Cheers,
>
> Roger
> __________________________________________________________________
> Get your own FREE, personal Netscape Webmail account today at
>http://webmail.netscape.com/
The problem is most likely that you are not following the xpcom
transfer of ownership rules for 'out' string. See:
http://www.mozilla.org/scriptable/faq.html#i9 (note that
'nsIAllocator' and 'nsAllocator' were renamed 'nsIMemory' and
'nsMemory' and some documents have not been fully updated)
John.