We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpSyntax Questions › Cleaning UP: On Close
Page Index Toggle Pages: 1
Cleaning UP: On Close (Read 529 times)
Cleaning UP: On Close
Jun 8th, 2009, 6:10am
 
Hi,

Since I'm using the UDP tools and have an open port, I'm wondering how to detect an "on close" type event to dispose() of the resources I'm using when I close the Processing applet/lication.

Is there some default method for cleaning up the state of affairs on a close?

Cheers!
Re: Cleaning UP: On Close
Reply #1 - Jun 8th, 2009, 6:20am
 
stop() function is called when the sketch is closed:
Code:
void stop()
{
// Do stuff
// ...
super.stop();
}
Re: Cleaning UP: On Close
Reply #2 - Jun 8th, 2009, 6:33am
 
Magic. Thanks.
Page Index Toggle Pages: 1