Entry: JSPRINCIPALS_DROP (Macro)
Summary: Decrements the reference count for a specified JSPrincipals struct, and destroys the principals if the reference count is 0.
Syntax:
JSPRINCIPALS_DROP(cx, principals)
Description:
JSPRINCIPALS_DROP decrements the specified principals in a JSPrincipals struct, principals, for a specified JSContext, cx. The principals are dropped by deccrementing the reference count field in the struct by 1. If the reference count drops to zero, then JSPRINCIPALS_DROP also destroys the principals.
Example:
The following code decrements the principals reference count for the MyPrincipals struct, destroying the principals as well:
JSPrincipals MyPrincipals;
JSContext * MyContext;
JSRuntime *rt;
.
.
.
rt = Js_Init(32768);
MyContext = JS_NewContext(rt, 16384);
.
.
.
JSPRINCIPALS_HOLD(MyContext, MyPrincipals);
.
.
.
JSPRINCIPALS_DROP(MyContext, MyPrincipals);
See also:
|
|
|