ofSimpleApp destructor not called on exit?

Hi… just wondering if anyone else has noticed that the ofSimpleApp’s destructor doesn’t get called when the program terminates?

I notice in the ofRunApp there is


and in ofExitCallback there is an event trigger

ofAppEvents.notifyExit( NULL );  

but I can’t seem to make it call my destructor… even if in my main method I do

	ofSimpleApp* myApp = new BlobTrackerTest();  
	delete myApp;  

Was wondering if anyone had an idea of how I could properly do my program end routines?


I believe the issue is rooted in the use of
atexit(ofExitCallback); and

This means that the ofRunApp actually never returns execution to the main(). I forgot whether there was a reason for this. Seems to me too that either execution should come back to the main function or ofRunApp should be owning of the app pointer and make sure it is deleted when exiting.

This shouldn’t be a show stopper for you. Simply put all the clean up in the exit() method of testApp. If you don’t have one simply add one and it will be called when the app exits.

oh k… thanks for the reply stefanix. I will add an exit() method to my ofSimpleApp.