Jump to content

  • Log In with Google      Sign In   
  • Create Account

- - - - -

Function release crash and wrong error message, maybe?


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
3 replies to this topic

#1 saejox   Members   -  Reputation: 714

Like
0Likes
Like

Posted 21 October 2012 - 02:11 PM

Hi,

asIScriptFunction *func =  mod->GetFunctionByDecl("void main()");
ctx->Prepare(func);
ctx->Execute();
ctx->Unprepare();
ctx->Release();
func->Release();
engine->Release();

It is an error message followed by a crash.

func shouldn't be released here, but i did it by mistake.
Error message says the opposite of what happens here.
GC cannot free an object type of '_builtin_function_', it is kept alive by the application.

i looked around the code for an extra func->AddRef() for hours.
Did i misinterpret this error message?
or is this a bug?

Thank you.

Sponsor:

#2 Andreas Jonsson   Moderators   -  Reputation: 3445

Like
0Likes
Like

Posted 21 October 2012 - 02:57 PM

The premature release of the function probably caused this problem. It's much the same as if you free memory too early. It can be difficult to predict the result after an error like that.
AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

#3 saejox   Members   -  Reputation: 714

Like
0Likes
Like

Posted 21 October 2012 - 03:21 PM

since func->AddRef(); and func->Release(); produce the same error, i will identify func->Release(); error by the crash from now on :)

#4 Andreas Jonsson   Moderators   -  Reputation: 3445

Like
0Likes
Like

Posted 21 October 2012 - 05:37 PM

If you have any idea how I can catch an incorrect call to Release() from the application I'd gladly implement it. It would definitely be good if the library could identify these kind of problems without the need to do exhaustive manual investigations.

Edited by Andreas Jonsson, 21 October 2012 - 05:38 PM.

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




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS