Subj : Re: GC question To : netscape.public.mozilla.jseng From : Sterling Bates Date : Thu May 27 2004 09:37 pm lyg wrote: > because when i open a new document, i need a "root object" to manager the > objects created in the new document, I have to create many global objects > for the root objects. when I access the opened document, i just fetch the > rooted "root object" and JS_SetGlobalObject(). In other words, at the same > time, there is only one object as the global object and the others are > rooted not to GCed. When i want close the document, I will > JS_RemoveRoot(rootedObj) to let it GCed. Now it > is not the global object, why not be GCed? Try deleting the object from whatever scope you've created it under. Sterling .