Advertisement

Crash On Closing Modules With Shared And Funcdef

Started by August 03, 2016 05:18 PM
3 comments, last by Violet CLM 8 years, 3 months ago

Given the following file header.as,


funcdef void functype();
shared class classname {}

and two separate script modules that are both loaded by the application, in this order,


#include "header.as"

#include "header.as"
classname classinstance;

my application consistently crashes when the modules are closed. (Pasting the contents of header.as into each module instead of using #include doesn't make any difference, but this felt clearer.) Removing any of the lines prevents the crash. Loading (and therefore probably closing) the modules in the other order prevents the crash.

What do you mean by closing a module? Do you mean discarding?

Are you compiling the two scripts into two modules with different names, or are you reusing the module to compile one after the other?

Which version of AngelScript are you currently using?

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

Yes, discarding:


if (ASengine)
  while (ASengine->GetModuleCount())
    ASengine->GetModuleByIndex(0)->Discard();

They are separate modules, as I said. Multiple calls are made to CScriptBuilder::StartNewModule.

2.31.1.

ETA: I tried running the application in debug mode and got two asserts, I guess during compilation: asASSERT(func->objectType == intfType); at line 2541 of as_builder.cpp, and asASSERT((asUINT)intfFunc->vfTableIdx == j); at line 3002 of the same file.

I've fixed the crash while discarding modules containing shared funcdefs in revision 2342.

Let me know if you still face any problems.

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

Hmm. I think the crash is gone now, but I'm getting other asserts in a complicated set of circumstances... I'll let you know when I figure out what's going on/a minimal test case.

This topic is closed to new replies.

Advertisement