When you say that your javascript code exits, what javascript code are you
referring to? The javascript that creates the XPCOM?
In my case, I am creating a taskbar icon, so I pass a callback, say
onDoubleClick which will be called when the TrayIcon is double-clicked.
However, when I close the XUL window that creates the TrayIcon, the callback
doesn't work anymore. But fortunately, even when I call the onDoubleClick
callback from XPCOM, it doesn't crash.
This, I believe, is because the context of the callback doesn't exist
anymore, and it doesn't make sense for the code to run, which is fine with
me.
Regards,
Kok Hoor
"dupes" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I'm pretty sure XMLHttpRequest doesn't have to addref becuase it uses
> an nsCOMPtr for it's callback object, and using nsCOMPtr automatically
> addrefs the object. I had one implementatin where I used a regular
> pointer to point to the javascript callback and that implementation
> crashed when I tried to call the callback after the SetCallback
> function exited. Adding and addref call fixed the problem. Next, I
> tried using an nsCOMPtr object and this implementation worked without
> doing an addref.
>
> I have a feeling you object is a little different than mine. My object
> creates a thread (using the NSPR thread library included with mozilla
> source) that continues to run after the javascript code exits. The
> callback works fine until the javascript code exits. Does your
> callback work after your javascript code exits?
>
_______________________________________________
Mozilla-xpcom mailing list
[email protected]
http://mail.mozilla.org/listinfo/mozilla-xpcom