Original Post
Dear subscribers, another update has been made. There's been a few changes to the interface to make it more consistent and easier to use. However, after receiving user feedback, I have kept backwards compatibility with 1.9.x. Though this backwards compatibility is only available if the library and host application is compiled with the preprocessor define AS_DEPRECATED. The methods that have changed are:
- RegisterObjectBehaviour(), it only accepts true object behaviours now, i.e. the ones that you register with the first parameter naming the object. Another method, RegisterGlobalBehaviour(), has been created for the other behaviour functions.
- GetFunctionName(), GetFunctionDeclaration(), GetGlobalVarName(), GetGlobalVarDeclaration(), GetImportedFunctionDeclaration(), and GetExceptionString() has changed to return const char * instead so that you no longer have to allocate the buffer before. The pointer that is returned is shared between these functions so you shouldn't store it for later use.
- All methods that return a string, also take an optional parameter that allow the host to get the length of the returned string directly instead of calling strlen().
- All reference counting is now threadsafe
- asGetActiveContext() is working correctly
- The shared string (mentioned above) is working by keeping a string buffer for each thread
- Created a new global function asThreadCleanup() that should be called before terminating any secondary threads that have accessed the library. If it is not called the local data allocated for the thread will be cleaned up at application exit. Note, it is not necessary to call this function in a single threaded environment.