Subj : custom object lifetime question. To : netscape.public.mozilla.jseng From : donteventthinkaboutit Date : Mon Jul 19 2004 10:39 pm Two questions really. One: I am using JS_DefineObject to create objects of a custom class in my application. Since this isn't a JS_New* function, As far as I can gather, I do not need to use JS_AddRoot. Is this correct? Two: When my application is done with this object, How do I tell spidermonkey that I no longer need it? It is possible that some variables in the runtime may maintain references to this object, even after the Native application is done with it, so it cannot be destroyed outright. How do I signal to signal to spidermonkey that the object can now be garbage collected as far as the Native app is concerned? .