At the top of my sketch, I name an object that will be called from various other places/methods:
Code:MovieMaker movie;
I don't instantiate the object yet, not even in setup(), because I won't have the information I need for that until later (say, 30 seconds after the sketch starts running). So, at a certain point of time, I have a method that gathers the right info and instantiates the object:
Code:movie = new MovieMaker(applet, width, height, "video" + currentRecordingID + ".mov", 15, MovieMaker.ANIMATION, MovieMaker.HIGH);
Then I record frames for my movie object, and eventually I call:
Code:movie.finish();
The thing is, I want to reuse this object called "movie" again and again, to make new recordings. I don't want to use an array of MovieMaker objects, for various reasons. So my question is, what is the best way to delete/overwrite/recycle an existing, named object ("movie") re-instantiating it, as though it were a new object?
I have tried simply instantiating again, as in "movie = new MovieMaker(...)", but then got this error, which may or may not be related:
Code:java(442,0xa041e720) malloc: *** error for object 0x42f34490: double free
*** set a breakpoint in malloc_error_break to debug
Is there a way to "clear out" an object, or un-instantiate it? Thanks!