Subj : Re: Garbage Collection Woes To : Stephen Jones From : Brendan Eich Date : Thu May 01 2003 07:12 pm Stephen Jones wrote: >One more piece of information . . . this only seems to happen to objects >created in contexts other than the global context . . . am I doing >something wrong when executing GC? This is the code I am using . . . > > while( ( theCurrentContext = JS_ContextIterator( m_JSRunTimePtr, >&theContextIterator ) ) != NULL ) > { > JS_GC( theCurrentContext ); > } > >Is the "live-thing" graph different for different contexts? > > No. Therefore you don't need to call the GC more than once per runtime, using any context created in that runtime. You shouldn't add a bunch of JS_AddNamedRoot calls without knowing why you need each one. Remove all that you don't believe you need. Make sure you aren't passing object pointers or jsvals by value to JS_Add*Root. You have to pass the address of a JSObject* or jsval to register a root. /be .