Jump to content
  • Advertisement
Sign in to follow this  
BertS

Problem with child funcdef registration

Recommended Posts

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

Share this post


Link to post
Share on other sites
Advertisement

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

What version of the library are you using?

Regards,

Andreas

Share this post


Link to post
Share on other sites

Hello Andreas,

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

Regards,

Bert

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!