• Create Account

### #Actualizackp

Posted 05 March 2013 - 12:39 PM

Not really the dictionary object just resides in a Testcomponent class which is just a container of class members and does nothing atm.

Sprite registers the proper behaviors. It does implement enum references, but it doesn't hold any references as of yet.

It really weird because the RenderComponent destructor gets called, but I still get the error.

This is the only thing angelscript script code that I run:

asIScriptModule* mod = builder.GetModule();
int testTypeId = mod->GetTypeIdByDecl("TestComponent");
asIObjectType *type = mod->GetObjectTypeByName("TestComponent");
testTypeId = type->GetTypeId();
asIScriptObject* objLogicComp = static_cast<asIScriptObject *>(engine->CreateScriptObject(testTypeId));
engine->NotifyGarbageCollectorOfNewObject(objLogicComp, type);
std::cout << "Ref Count: " << objLogicComp->Release() << std::endl;
std::cout << "Ref Count: " << objLogicComp->Release() << std::endl;
engine->GarbageCollect(asGC_FULL_CYCLE | asGC_DETECT_GARBAGE | asGC_DESTROY_GARBAGE);


TestComponent is just an empty class with a Render Component inside of it.

So the destructor of both TestComponent and RenderComponent gets called . Yet I still get these errors in my logs:

add - 2 - instanceId:1 - Sprite
add - 3 - instanceId:1 - Sprite
rel - 2 - instanceId:1
RenderComp Create
add - 2 - instanceId:2 - RenderComponent
add - 3 - instanceId:2 - RenderComponent
rel - 2 - instanceId:2
TestComp Create
rel - 1 - instanceId:2 //This release seems unusual
Ref Count: 2
Ref Count: 1
TestComp Destroy
RenderComp Destroy
//Sprite does not get destroyed
//Shutdown Engine
(0, 0) : ERR : GC cannot free an object of type 'TestComponent', it is kept alive by the application
(0, 0) : ERR : GC cannot free an object of type 'RenderComponent', it is kept alive by the application
(0, 0) : ERR : GC cannot free an object of type 'Sprite', it is kept alive by the application
rel - 1 - instanceId:1
(0, 0) : ERR : GC cannot free an object of type '_builtin_objecttype_', it is kept alive by the application


### #2izackp

Posted 05 March 2013 - 12:33 PM

* edit* sorry - I need to try the enumref behavior stuff first before replying... *

### #1izackp

Posted 05 March 2013 - 12:29 PM

Not really the dictionary object just resides in a Testcomponent class which is just a container of class members and does nothing atm.

It really weird because the RenderComponent destructor gets called, but I still get the error.

This is the only thing angelscript script code that I run:

    asIScriptModule* mod = builder.GetModule();
int testTypeId = mod->GetTypeIdByDecl("TestComponent");
asIObjectType *type = mod->GetObjectTypeByName("TestComponent");
testTypeId = type->GetTypeId();
asIScriptObject* objLogicComp = static_cast<asIScriptObject *>(engine->CreateScriptObject(testTypeId));
engine->NotifyGarbageCollectorOfNewObject(objLogicComp, type);
std::cout << "Ref Count: " << objLogicComp->Release() << std::endl;
std::cout << "Ref Count: " << objLogicComp->Release() << std::endl;
engine->GarbageCollect(asGC_FULL_CYCLE | asGC_DETECT_GARBAGE | asGC_DESTROY_GARBAGE);


TestComponent is just an empty class with a Render Component inside of it.

So the destructor of both TestComponent and RenderComponent gets called . Yet I still get these errors in my logs:

add - 2 - instanceId:1 - Sprite
add - 3 - instanceId:1 - Sprite
rel - 2 - instanceId:1
RenderComp Create
add - 2 - instanceId:2 - RenderComponent
add - 3 - instanceId:2 - RenderComponent
rel - 2 - instanceId:2
TestComp Create
rel - 1 - instanceId:2 //This release seems unusual
Ref Count: 2
Ref Count: 1
TestComp Destroy
RenderComp Destroy
//Sprite does not get destroyed
//Shutdown Engine
(0, 0) : ERR : GC cannot free an object of type 'TestComponent', it is kept alive by the application
(0, 0) : ERR : GC cannot free an object of type 'RenderComponent', it is kept alive by the application
(0, 0) : ERR : GC cannot free an object of type 'Sprite', it is kept alive by the application
rel - 1 - instanceId:1
(0, 0) : ERR : GC cannot free an object of type '_builtin_objecttype_', it is kept alive by the application


PARTNERS