this happens whenever I use that object type as a member property of a complete angelscript class (a class not declared in c++). However, i dont have a problem when I use a c++ defined class in a limited scope such as 'Texture' in setSpriteWithName:

From the error messages my guess is that you have an instance of a CScriptDictionary that is probably only released after the engine is released. The dictionary object would hold on to a reference of the RenderComponent, and also to the built-in object that describes the RenderComponent (i.e. asIObjectType). The RenderComponent is then holding on the the Sprite object.

The test component is a script class. It will automatically add itself to the GC when it is created in the call to engine->CreateScriptObject(). You must not do this manually.

A second problem is that you're calling Release() twice, but the application only owns 1 reference. That is the one you received from CreateScriptObject(). The application must never call Release() for references it doesn't own.

Well I'm glad I'm making progress and understanding angelscript more. That code brings the ERRs down by 1 though

(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

(0, 0) : ERR : GC cannot free an object of type '_builtin_objecttype_', it is kept alive by the application

However, I will figure it out.. I think I might just rebuild a minimal project to replicate the problem and try to isolate it. In situations like this I would normally breakpoint Release and AddRef and see which is being called when it isn't supposed to be called, but theres so much I don't know about the engine for me to dig through it.. Hopefully I figure this out soon xD