I can create a global objects with
JS_NewCompartmentAndGlobalObject
(SM 1.8.5) or a similar function
but how do I delete the global object. As far as I know the global object is rooted and thus no GC thing. At the end I can call JS_DestroyContext but to call JS_GC I must have a context. When is the global object garbage collected?