I found memory leak bug again.
Please investigate.
Revision
r604
Compiler
MSVC8
modified scriptarray.cpp (add method named 'hoge')
namespace{ void t_hoge(asIScriptGeneric*){} }void RegisterScriptArray_Generic(asIScriptEngine *engine){ ... r = engine->RegisterObjectMethod("array<T>", "void hoge(const T&in)" , asFUNCTION(t_hoge), asCALL_GENERIC); assert( r >= 0 ); }
main.cpp
//-----------------------------------------------------------// C++ source codenamespace{ // alloc counter int t_allocCount = 0; // alloc function void* t_alloc( const size_t aSize ) { ++t_allocCount; // inc t_allocCount return std::malloc( aSize ); } // free cuntion void t_free( void* aPtr ) { std::free( aPtr ); --t_allocCount; // dec t_allocCount }} int main(int argc, char **argv){ // set allocator asSetGlobalMemoryFunctions( t_alloc , t_free ); // Create the script engine asIScriptEngine *engine = asCreateScriptEngine(ANGELSCRIPT_VERSION); // Register array class RegisterScriptArray_Generic(engine); // Compile asIScriptModule *mod = engine->GetModule(0, asGM_ALWAYS_CREATE); mod->AddScriptSection("script", "class Hoge" "{" " HogeManager@ hogeManager;" "};" "class HogeManager" "{" " array< Hoge >@ hoges;" "};" , 0); mod->Build(); // Release engine engine->Release(); // check assert( t_allocCount == 0 ); // assertion failed return 0;}