Subj : Re: Optimizing DestoryContext() ? To : bubbfree From : Brendan Eich Date : Fri Jan 28 2005 08:30 am bubbfree@gmail.com wrote: > Is the only side effect of JS_DestroyContextNoGC that any finalizers I > may have specified in custom objects will not get called? (and > therefore may leak some native code if I were doing delete > JS_GetPrivate(...) in the finalizer)? Not if you destroy all contexts (whether by NoGC or not), destroy all runtimes, and call JS_ShutDown before exiting or hibernating. The last JS_DestroyContext* API call will run a GC, no matter which API of that form you call on the last context in the runtime. > Or does JS_DestroyContextNoGC call finalize on all the objects no > matter what their scope? Finalization is run from the GC, and GC is a global (runtime-wide, not per-context) procedure. > Is there a function that will print out everything in the system? I > guess I can do some recursive debug output on the global object. I will > try that out. It shouldn't be a long list, but maybe something is going > wrong in my code/. If you have leaks, look into using the GC_MARK_DEBUG facilities: js_LiveThingToFind, js_DumpGCHeap. /be .