contents   index   previous   next



Whenever you have an initialization function, you have a corresponding termination function. Like jseSecurityInit, this function gets a single parameter, the security variable (described below.) This function is rarely needed, and you can simply not specify it most of the time. It is included so that you can clean up the security variable before exiting. You do not need to unset the setSecurity() calls done, as the engine knows that they go away when they are no longer used. The security termination function looks like this:


function jseSecurityTerm(security_var)


   /* do any necessary cleanup */



This function is not usually called until the end of the program (not just the end of the script.) Why is this? For ISDK developers, if you have read the advanced concepts chapter, you know that all of the functions in a jseInterpret() stick around in the global object, even after the jseInterpret() call itself is finished. This is why you can load functions using jseInterpret() and later call them. Whatever security they had when they were created is not forgotten.


All functions remember the security in effect when they were created, and that applies if they are again called later. So, the security termination function is not actually called until all of the functions have gone away, which happens at the end of the program when the ScriptEase engine cleans up everything.