Advertisement

Problem with child funcdef registration

Started by March 19, 2019 05:34 PM
3 comments, last by WitchLord 5 years, 8 months ago

Hello,

Not sure if this is the proper spot to report (potential) bugs, but I've run into a problem when using child defs. This is my situation:


TRY_REGISTER(pEngine->RegisterObjectType("MyTemp<class T>", 0, asOBJ_REF | asOBJ_TEMPLATE | asOBJ_GC));
TRY_REGISTER(pEngine->RegisterFuncdef("void MyTemp<T>::Func(const T&in if_handle_then_const param)"));

I then register a specialization, like so:
 


TRY_REGISTER(pEngine->RegisterObjectType("MyTemp<void>", 0, asOBJ_REF | asOBJ_GC));
TRY_REGISTER(pEngine->RegisterFuncdef("void MyTemp<void>::Func()"));

Now when shutting down the engine, this crashes my application, because asCScriptEngine::RemoveFuncdef is called for my second funcDef  and this will remove it from the funcDef list of the engine, but it is kept inside the defaultGroup.types list. So when the engine does defaultGroup.RemoveConfiguration it crashes when it tries to access the deleted funcdef.

To fix this locally, I just removed the funcdef from any group type lists as well in asCScriptEngine::RemoveFuncdef, but this rather looks like a ref count gone wrong somewhere.

Am I missing something? I don't need to use the type to repro this crash, so it doesn't look like I'm messing up my ref counts on the application side. Just registering the funcdef and not using it anywhere as part of any function declarations is enough to trigger this crash.

Regards,

Bert

It does indeed appear to be a bug. I'll investigate it.

What version of the library are you using?

Regards,

Andreas

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

Hello Andreas,

I am using the latest SVN build for this. Thanks for looking into this!

Regards,

Bert

I've fixed this in revision 2594

Sorry for the delay.

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

This topic is closed to new replies.

Advertisement