Visit Mozilla.org

JS DestroyContext

From MDC

(Redirected from JS DestroyContextNoGC)

Destroy a JSContext.

[edit] Syntax

void JS_DestroyContext(JSContext *cx);

void JS_DestroyContextNoGC(JSContext *cx);

void JS_DestroyContextMaybeGC(JSContext *cx);
Name Type Description
cx JSContext * The context to destroy.

[edit] Description

These functions destroy a context, cx. JS_DestroyContext additionally performs garbage collection to reclaim any memory that was being used by cx's global object. JS_DestroyContextNoGC does not perform garbage collection. JS_DestroyContextMaybeGC may or may not perform garbage collection; the engine makes an educated guess as to whether enough memory would be reclaimed to justify the work.

In a JS_THREADSAFE build, the application must not be in a request on cx.

If JS_SetContextCallback has been called, this calls the callback.

LXR ID Search for JS_DestroyContext
LXR ID Search for JS_DestroyContextNoGC
LXR ID Search for JS_DestroyContextMaybeGC