Entry: JS_SetGCCallback (Function)
Summary: Specifies a new callback function for the garbage collector.
Syntax:
JSGCCallback JS_SetGCCallback(JSContext *cx, JSGCCallback cb);
Description:
JS_SetGCCallback enables you to specify the function is called by the garbage collector to return control to the calling program when garbage collection is complete. cx is the context in which you specify the callback. cb is a pointer to the new callback function to use.
JS_SetGCCallback returns a pointer to the previously used callback function upon completion. Your application should store this return value in order to restore the original callback when the new callback is no longer needed.
To restore the original callback, simply call JS_SetGCCallback a second time, and pass the old callback in as the cb argument.
See also:
|
|
|