|
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.
|
|
|
|
fjen
|
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
|
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
|
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.
|
|
|
|
|