Subj : JS_AddRoot & JS_RemoveRoot To : netscape.public.mozilla.jseng From : "Edward Chan" Date : Fri Sep 05 2003 07:23 pm Can you call JS_AddRoot multiple times for an object? And does every JS_AddRoot need to be matched with JS_RemoveRoot? For example, if I do: JS_AddRoot(cx, &pObj); ..... JS_AddRoot(cx, &pObj); ..... JS_RemoveRoot(cx, &pObj); Is the JSObject pointed to by pObj still rooted and protected from being gc'd (since I've called add twice, and remove only once)? Or does is it the case that once JS_RemoveRoot is called, that's it, the obj is unrooted, and gc'able? Thanks, Ed .