When I suspend the as context and try to close my application I have crash in: void asCScriptEngine::CallFree(void *obj) const
It's trying to free something that's already freed (feeefeee).
Short callstack (I hope it will help): asCScriptEngine::CallFree(void * obj=0x0ed5a350) Line 3317 + 0xc bytes C++
asCContext::CleanStackFrame() Line 3860 C++
asCContext::CleanStack() Line 3602 C++
asCContext::Unprepare() Line 400 C++
asCContext::DetachEngine() Line 210 + 0xf bytes C++
asCContext::~asCContext() Line 182 C++
asCContext::`scalar deleting destructor'() + 0x2b bytes C++
asCContext::Release() Line 195 + 0x1a bytes C++
My AngelScript version: #define ANGELSCRIPT_VERSION 22201
#define ANGELSCRIPT_VERSION_STRING "2.22.1 WIP"
Does it happen with any script you suspend, or must it for example be a call to an class method, or perhaps the function needs to have a specific parameter?
The context shouldn't attempt to free anything that has already been freed, unless there is some object that is freed before it's refcounter reaches 0, or the refcounter is forced to 0 too early by calling Release() multiple times.
I fixed a bug in revision 1323 that may have been what was causing this crash.
When a context was suspended in a function that returned a value type by value, the context would incorrectly try to cleanup the return value, even though it was never actually created.
I'm not sure if this is the exact same situation that you reported, but as I have not been able to reproduce it in any other way I'll consider this bug fixed.