Advertisement

Memory leak bug part2

Started by June 25, 2010 11:46 AM
1 comment, last by hoboaki 14 years, 5 months ago
Hi!
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;}

Fixed in revision 606. Thanks.

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

Advertisement
I confirmed that this bug was fixed at r606.
Thank you very much!

This topic is closed to new replies.

Advertisement