The newly released ScriptEase ISDK v. 4.30d provides a useful new feature called the jseWeakAPIReference
jseVariable, and the jseVariable needs a reference to the C++ object. These two different environments then need to retain a lock on each other, so how do either of them know when it's time to clean up?
Weak referencing solves this "catch-22" situation by allowing you to link to a C++ object directly, without locking in its lifetime or needing to add external reference counting. You can continue to
access a weak reference variable, but the garbage collector will ignore it.
To use weak referencing, the changes you need to make to your code are surprisingly minimal. Just build with the JSE_WEAK_REFERENCE defined in the jseopt.h file and then apply the jseWeakAPIReference flag to any variable you want to retrieve in this matter. Once an object is marked as a having a
However, when using this flag, the calling code must install a delete callback in order to receive notification of when the ScriptEase engine has determined the referenced variable is no longer needed.
In summary, with jseWeakAPIReference, you can now create a
Have a question about how to use ScriptEase:ISDK? Let Dr. Scripter know at http://support.nombasxxx.com/