Jump to content

  • Log In with Google      Sign In   
  • Create Account


Xifos

Member Since 19 May 2013
Offline Last Active Jul 30 2014 01:26 PM
-----

Posts I've Made

In Topic: Memory leak in virtual properties

30 June 2013 - 11:42 AM

I was able to sandbox the leak with the following:

 

Create a file 'test1.as'

shared class TestClass {
    int mProp {
        get {
            return 0;
        }
    }
}

Create a file 'test2.as'

#include "test1.as"
class TestClass2
	: TestClass
{
}

Now execute this code:

{
    asIScriptEngine *engine = asCreateScriptEngine(ANGELSCRIPT_VERSION);
    CScriptBuilder builder, builder2;
    asIScriptModule *mod;
    builder.StartNewModule( engine, "test1" );
    builder.AddSectionFromFile("test1.as");
    builder.BuildModule();
    mod = builder.GetModule();
    builder2.StartNewModule( engine, "test2" );
    builder2.AddSectionFromFile("test2.as");
    builder2.BuildModule();
    mod = builder2.GetModule();
    engine->Release();
}

The 'shared' on the class TestClass is necessary to reproduce this.


PARTNERS