so i studied the game tutorial a little bit and tried to adjust it a little bit for my needs. the problem is, that within the scriptmgr the application always crashes when it comes to the engine->Release() line and i have no idea why.
http://codepad.org/4Z5ovVZl <-- that's the main. i try to create the scriptmgr, create an object(in my case a unit), call the onattack method of the script and then release everything.
http://codepad.org/3aV40mGt <-- that's the uni object (similiar to the gameobj of the game sample). i don't get it, why the sample uses a gameobjlink? what are the advantages of using an extra link class?
http://codepad.org/w0XuBzXy <-- that's the scriptmgr class. line 33 causes the crash. it's nearly a 1:1 copy of the game sample scriptmgr.
http://codepad.org/5xoPJMsG <-- the sample scriptfile Frosch.as
the debugmsgs are:
finished successfully (line228 of scriptmgr) which tells me, that it loads the file successfully and the script file itself is without errors. then it prints 1(line28) and 2 (line31) so the cleanup of the contexts and scriptunits succeeds to. after that the application crashes and due to the debugger it crashes when calling the engine->Release method (line 33).
what am i doing wrong again?

best regards
edit:
debugged some more, seems like it only crashes when it successfully loads the scriptfile. when i test it with an invalid path, everything is finde. additionaly i got this error msg when it comes to the release line:
"Type asCScriptEngine has no component named _contextsType asCScriptEngine has no component named _contexts"
edit2:
k it seems like it DOES need this gameobjlink class in order to work correctly. if i add a similar class to my application, everything works just finde. i don't quite get it why, but i hope i will soon get it why ... hm
