notifyDeleted and Jitter objects ..

Julien Bayle's icon

I instantiate objects from Java.
ok

when I delete the mxj, all OB3D stuff is still visible, but moveable etc... only the reference with the Java code is broken

In JS, it is different.

So I guess I have to do something in notifyDeleted.
All my objects are stored in a basic array.

How can I delete each object, then clear the memory taken by my array ?
garbage collector should do that no?

Julien Bayle's icon

Ok.
freePeer() did the trick.

public void notifyDeleted(){
    for(int i = 0 ; i < OBJECT_COUNT ; i++){
        myObjectsArray[i].freePeer();
        finalize();
    }
}

I guess it is also the way to cleanly remove a jitter object at runtime

Julien Bayle's icon

looking for to do that in JS.. to safely clean the stuff

TobyAM's icon

I'm looking pretty desperately for a solution to this as well.

So there's this reference page: http://max-javascript-reference.tim-schenk.de/symbols/#freepeer&gsc.tab=0

Which references:
Method Summary void freepeer() Deletes the JitterObject

But if I make a bunch of GL objects in Javascript:
mysphere[TID] = new JitterObject("jit.gl.gridshape","blurnode");
mysphere[TID].name = TID;
mysphere[TID].varname = TID;

I can't delete these objects.
Variations on freepeer() method don't seem to remove the objects. I've tried things like:
for(var i in mysphere){
        mysphere[i].freepeer();
    }

When I try to delete the objects and recreate the objects I get the error:
name 4366923 already in use. ob3d does not allow multiple bindings
iterated over names [i]

I've spent a lot of time messing with this. I just want to free up these names and let me bind to ob3d under these names again fresh. Heck, I would even rebind back to these objects if I knew how. Or delete all objects in the whole render. I don't mind, I just want to regenerate these objects with these names.

Any help would be amazing!

TobyAM's icon

freepeer() does actually work as intended!