Function mozjs::jsapi::JS_ShutDown
source · pub unsafe extern "C" fn JS_ShutDown()
Expand description
Destroy free-standing resources allocated by SpiderMonkey, not associated with any runtime, context, or other structure.
This method should be called after all other JSAPI data has been properly cleaned up: every new runtime must have been destroyed, every new context must have been destroyed, and so on. Calling this method before all other resources have been destroyed has undefined behavior.
Failure to call this method, at present, has no adverse effects other than leaking memory. This may not always be the case; it’s recommended that all embedders call this method when all other JSAPI operations have completed.
It is currently not possible to initialize SpiderMonkey multiple times (that is, calling JS_Init/JSAPI methods/JS_ShutDown in that order, then doing so again). This restriction may eventually be lifted.