Visit Mozilla.org

JS DestroyScript

From MDC

Free a compiled script that is no longer needed.

[edit] Syntax

void JS_DestroyScript(JSContext *cx, JSScript *script);
Name Type Description
cx JSContext * The context in which to destroy the script.

Requires request. (In a JS_THREADSAFE build, the caller must be in a request on this JSContext.)

script JSScript * The script to destroy.

[edit] Description

JS_DestroyScript destroys the given compiled script, freeing the memory allocated to it. The script must not be currently executing (in any context, at any level of the stack) and must not be used again afterwards.

Do not use JS_DestroyScript on a script if JS_NewScriptObject was successfully called on it.

LXR ID Search for JS_DestroyScript