FAQ
Cover
This is the archive Discourse for the Processing (ALPHA) software.
Please visit the new Processing forum for current information.

   Processing 1.0 _ALPHA_
   Programming Questions & Help
   Syntax
(Moderators: fry, REAS)
   Delete?
« Previous topic | Next topic »

Pages: 1 
   Author  Topic: Delete?  (Read 390 times)
blockage


Delete?
« on: Aug 18th, 2004, 4:18am »

I'm sure this is a really dumb question, but I'm going to ask it anyway...
 
What's the command for deleting an instance of a class (or any data for that matter)? The token 'delete' causes a compile error.
 
narain


Re: Delete?
« Reply #1 on: Aug 18th, 2004, 7:24am »

You mean like C's free() and C++'s delete()?
 
You don't need it. Java's garbage collector does all your memory management for you.
 
http://java.sun.com/docs/books/tutorial/java/data/garbagecollection.html
 
fjen

WWW
Re: Delete?
« Reply #2 on: Aug 18th, 2004, 7:58am »

just set it null --- so it can be collected. like:
 
myClass myclass = new myClass();
myclass.move();
myclass.draw();
myclass = null;  // now it can be garbage collected.
 
 
blockage


Re: Delete?
« Reply #3 on: Aug 18th, 2004, 1:48pm »

Does this work 100% of the time?  
 
I've noticed a lot of p5 apps take over the CPU and don't release it again, even after I surf to another page. On several occasions I've had to close my browser after surfing through the examples on proce55ing.net.
 
If this isn't do with garbage collection, any idea what causes it?
 
fjen

WWW
Re: Delete?
« Reply #4 on: Aug 18th, 2004, 5:36pm »

i experience the same problem all the time with safari. stupid thing chaches the jar as well, so sometimes i can't even check newer versions of something i'm working on. nope, clear cache doesn't do the job. grrrr.
 
blockage


Re: Delete?
« Reply #5 on: Aug 18th, 2004, 6:35pm »

If you're building the page dynamically you can usually beat the cache by sticking a random number on the end of the filename (e.g "sketch_040818b.jar?nocache="+random()).
 
I'm new to p5, but this works pretty well with flash.
« Last Edit: Aug 18th, 2004, 6:42pm by blockage »  
fjen

WWW
Re: Delete?
« Reply #6 on: Aug 19th, 2004, 12:11am »

good one ... seen it done by dreamweaver and many other apps "Temp230423042304.html". i'll try and build it into my xcode ant-build.xml. thanks.
 
Pages: 1 

« Previous topic | Next topic »