Boolean temporary variable as property not released

Started by
3 comments, last by WitchLord 5 years, 3 months ago

I have the following code:


if (g_serverDisplayNameTask.HasSucceeded) {
	g_serverDisplayName = g_serverDisplayNameTask.GetDisplayName(g_serverDisplayID);

I get a failed assertion in "asCCompiler::CompileStatementBlock": "tempVariables.GetLength() == 0". If I inspect the "node->tokenPos" there it points me to the 2nd line in the above snippet. Perhaps this means that the return value of get_HasSucceeded is getting leaked or so?

HasSucceeded is defined as "bool get_HasSucceeded()" and "void set_HasSucceeded(bool)", both with asCALL_GENERIC.

If I change the condition to be like "if (!x.y) {" then it doesn't happen. It also doesn't happen if I change it to "if (!x.y && true) {".

It also happens with much smaller similar pieces of code:


if (root.IsVisible) {
	root.Hide();
} else {
	root.Show();
}

It doesn't seem to happen with classes written in scripts, only from application registration.

This issue might be related, however I did add a set_X() function that simply throws an exception to work around the failed assertion:

 

Advertisement

Alright. I'll look into this after fixing the previous problem

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

I'm pretty sure they are definitely related - check out my new answer on that other thread. It's returning a bool by reference rather than by value which seems to cause this.

also fixed in revision 2578

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