mirror of
https://github.com/processing/processing4.git
synced 2026-02-11 09:39:19 +01:00
add a stop() to destroy() to prevent thread issues
This commit is contained in:
@@ -241,9 +241,23 @@ public class PApplet extends Applet
|
||||
}
|
||||
|
||||
|
||||
// public void destroy() is another one that gets called as the
|
||||
// applet viewer is shutting down the applet. stop() is called
|
||||
// first, and then destroy() to really get rid of things.
|
||||
/**
|
||||
* This also calls stop(), in case there was an inadvertent
|
||||
* override of the stop() function by a user.
|
||||
*
|
||||
* destroy() supposedly gets called as the applet viewer
|
||||
* is shutting down the applet. stop() is called
|
||||
* first, and then destroy() to really get rid of things.
|
||||
* no guarantees on when they're run (on browser quit, or
|
||||
* when moving between pages), though.
|
||||
*/
|
||||
public void destroy() {
|
||||
if (thread != null) {
|
||||
// call stop since this prolly means someone
|
||||
// over-rode the stop() function
|
||||
stop();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public Dimension getPreferredSize() {
|
||||
|
||||
Reference in New Issue
Block a user