JS_ShutDown 编辑
Free all resources used by the JS engine, not associated with specific runtimes.
Syntax
void
JS_ShutDown(void);
Description
Destroys all free-standing resources allocated by SpiderMonkey, not associated with any JSRuntime
, JSContext
, or other structure.
This method should be called after all other JSAPI data has been properly cleaned up: every JSRuntime
created with JS_NewRuntime
must have been destroyed with JS_DestroyRuntime
, every JSContext
created with JS_NewContext
must have been destroyed with JS_DestroyContext
, 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, to be future-proof.
It is currently not possible to initialize SpiderMonkey multiple times (that is, calling JS_Init, then other JSAPI methods, then JS_ShutDown in that order, then doing so again). This restriction may eventually be lifted.
Implementation note: This method has been used to clean up memory allocated by jsdtoa.cpp
, memory allocated to implement Date.now()
on Windows, and when the Internationalization API is enabled, memory internally allocated by ICU. Exact details about what this method cleans up will vary depending upon the version of SpiderMonkey in use.
See Also
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论