Please note, this is a STATIC archive of website developer.mozilla.org from November 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

JS_SetDestroyCompartmentCallback

This article needs a technical review. How you can help.

This article covers features introduced in SpiderMonkey 17

Set the callback function for each compartment being destroyed.

Syntax

void
JS_SetDestroyCompartmentCallback(JSRuntime *rt, JSDestroyCompartmentCallback callback);
Name Type Description
cx JSRuntime * The runtime to set the callback function.
callback JSDestroyCompartmentCallback Callback function which will be called for each compartment being destroyed (see below).

Callback function

typedef void
(* JSDestroyCompartmentCallback)(JSFreeOp *fop, JSCompartment *compartment);
Name Type Description
cx JSRuntime * The runtime of the compartments.
compartmentCallback JSCompartment * The pointer to the compartment which is to be destroyed.

Description

JS_SetDestroyCompartmentCallback sets callback function which will be called when sweeping each compartment of the runtime, before deleting the compartment.

See also

Document Tags and Contributors

 Contributors to this page: kscarfone, arai
 Last updated by: kscarfone,