Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


- - - - -

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
2 replies to this topic

#1 FDsagizi   Members   -  Reputation: 514

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

Sponsor:

#2 Andreas Jonsson   Moderators   -  Reputation: 3416

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

#3 Andreas Jonsson   Moderators   -  Reputation: 3416

Like
0Likes
Like

Posted 18 May 2014 - 06:45 PM

I've implemented the support for having the engine request a context from the application in revision 1929. 

 

For this to work the application needs to implement two callbacks and register them with engine->SetRequestContextCallback and SetReturnContextCallback.

 

With this, the application will be able to setup the context with what it needs to catch the exceptions, debug the script, etc. It can also be used to provide memory pooling for contexts, to improve performance.

 

Regards,

Andreas 


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