Jump to content

  • Log In with Google      Sign In   
  • Create Account

Awesome job so far everyone! Please give us your feedback on how our article efforts are going. We still need more finished articles for our May contest theme: Remake the Classics

Null pointer exception no show in destructor


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
1 reply to this topic

#1 FDsagizi   Members   -  Reputation: 394

Like
0Likes
Like

Posted 30 September 2012 - 05:49 AM

Hi Posted Image

This script:

class TestGC
{
	 TestGC @child;

	 ~TestGC()
	 {
			output( "Dest 1" );

			child.Do();

			output( "Dest 2" );
	 }
	 void Do(){}
}

void startGame()
{
	 TestGC @gc = TestGC();

	 @gc = null;

	

	 scene.RunGC();

	 output( "End" );
}

output:

Dest 1
End

Null pointer exception no show

#2 Andreas Jonsson   Moderators   -  Reputation: 2311

Like
0Likes
Like

Posted 03 October 2012 - 06:58 PM

As the destructor isn't necessarily called at the moment when the object goes out of scope, but only the last reference to it is released, any exception that occurs in the destructor isn't shown in the normal execution.

I'll look into how to make it possible to detect exceptions in the destructor for a future release.
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