From 81bc77a7fee2ba3a5d9bead8ff7262adc9f9e3fa Mon Sep 17 00:00:00 2001 From: benfry Date: Thu, 15 Jul 2004 15:01:33 +0000 Subject: [PATCH] add a stop() to destroy() to prevent thread issues --- processing/core/PApplet.java | 20 +++++++++++++++++--- processing/core/todo.txt | 17 ++++++++--------- 2 files changed, 25 insertions(+), 12 deletions(-) diff --git a/processing/core/PApplet.java b/processing/core/PApplet.java index deb40ccc0..4b6caf20d 100644 --- a/processing/core/PApplet.java +++ b/processing/core/PApplet.java @@ -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() { diff --git a/processing/core/todo.txt b/processing/core/todo.txt index ab2329ff0..b7b643d10 100644 --- a/processing/core/todo.txt +++ b/processing/core/todo.txt @@ -62,11 +62,10 @@ X if people have other threads they've spawned, impossible to stop X api to properly sense when applet has focus X add a 'focused' variable to the applet X code now in zipdecode, maybe just list this as a standard thing? - X include a lerp()? is there one in flash? X http://processing.org/discourse/yabb/YaBB.cgi?board=Programs;action=display;num=1083289030 X should it be called lerp or mix? -X acos, asin, log, exp, ceil/floor, pow, mag(x,y,z) +X acos, asin, atan, log, exp, ceil/floor, pow, mag(x,y,z) X color issues X doesn't work when outside a function: X color bg_color = color(255,0,0); @@ -74,15 +73,14 @@ X colorMode broken for red() green() etc X http://processing.org/discourse/yabb/YaBB.cgi?board=Proce55ing_software_bugs;action=display;num=1068664455 X add color(gray) and color(gray, alpha) X http://processing.org/discourse/yabb/YaBB.cgi?board=Proce55ing_software_bugs;action=display;num=1089898189;start=0 +o update() mode needs to be hacked in (?) +X make 'online' a boolean + MEGABUCKET (api) _ passing in args[] from main _ light(x, y, z, c1, c2, c3, TYPE) _ also BLight with same constructor, and on() and off() fxn -_ include in the docs: don't override stop() -_ or handle this some more intelligent way, super.stop() is needed. -_ http://processing.org/discourse/yabb/YaBB.cgi?board=Syntax;action=display;num=1083574943 -_ http://processing.org/discourse/yabb/YaBB.cgi?board=Syntax;action=display;num=1067383998 _ angleMode(DEGREES) and angleMode(RADIANS) _ http://processing.org/discourse/yabb/YaBB.cgi?board=Proce55ing_Software;action=display;num=1075507381;start=0 _ figure out how to handle cached images, multiple images @@ -103,9 +101,10 @@ _ slice, splice, reverse, concat, split _ more blend() modes? (the five listed on the thread below?) _ http://processing.org/discourse/yabb/YaBB.cgi?board=Proce55ing_Software;action=display;num=1082056702 _ seems like semi-standard modes -_ update() mode needs to be hacked in (?) -_ make 'online' a boolean - +_ write a threading example +_ or handle this some more intelligent way, super.stop() is needed. +_ http://processing.org/discourse/yabb/YaBB.cgi?board=Syntax;action=display;num=1083574943 +_ http://processing.org/discourse/yabb/YaBB.cgi?board=Syntax;action=display;num=1067383998 _ illustrator export / rendering mode _ also postscript or pdf export?