Jump to content
  • Advertisement
Sign in to follow this  
Miss

Boolean temporary variable as property not released

Recommended Posts

Posted (edited)

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:

 

Edited by Miss

Share this post


Link to post
Share on other sites
Advertisement

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.

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!