Subj : questions of js_GC To : netscape.public.mozilla.jseng From : "lyg" Date : Wed Mar 24 2004 05:30 pm Hi, In my app, I implemented a Global object named GlobObj. and use JS_AddRoot(cx, &cx->globalObject); In the following, I use JS_NewObject(....) to create a fieldObj, and then JS_SetProperty(cx,GlobObj, "field", &(jsval)fieldObj). optionsObj = JS_NewArrayObject(.......) JS_SetProperty(cx, FieldObj, "options", &(jsval)optionsObj) In this case, can I protect the optionsObj not to be collected by js_gc() in using js_addroot() function? In my app, why the optionsObj->map->slots[0] and slots[1] ... are changed to 0xcdcdcdcd or 0x10101010 after js_gc()? Thanks Regards! .