Subj : Re: JS_ASSERT in js_MarkScriptFilename() To : Edward Chan From : Brendan Eich Date : Thu Feb 19 2004 11:39 pm Edward Chan wrote: >We're not using JS_BeginRequest/JS_EndRequest. The reason is, we only have >1 thread running. Basically, this is the structure that we use. > > Sorry, Edward -- I keep forgetting this fact about your embedding. >So let me get back to the order in which we do things. The current order is >this: > >JS_CompileFileHandle >JS_ExecuteScript >JS_DestroyScript > >Should we be doing this instead: > >JS_CompileFileHandle >JS_NewScriptObject >JS_AddRoot >JS_ExecuteScript >JS_RemoveRoot >JS_DestroyScript > > I don't see why you should need to do this, given what you say about a runtime per thread. Unless you call JS_GC or JS_MaybeGC in between steps 1 and 2, you really shouldn't have any problems. So more debugging is necessary. >And my next question is when is it ok to call JS_DestroyScript? Is it ok to >destroy the script after executing it as we are doing here? > > Sure. /be .