my JS code create Max Objects on the patcher (=not encapsulated in JS)
I keep a trace of all objects created in JS arrays in order to be able to have a reference to them and to pass data, track etc.
If I want to make a safe clean, to free completely the memory related to that, I’m removing my objects from the patcher, but what SHOULD I do with my arrays ?
Actually, I’m basically doing that:
myArray.length = 0;
When I’m using JAVA, I have to explicitely call freePeer() method for each instantiated object.
BUT should I do that in JS if my code already removed the objects in the patcher …?
( I guess no, but I’d prefer to be sure)
I think js have a GC you don’t worried about that..
Yes in a browser JS will auto GC depending on scope of the var, I assume max adhere’s to that. I guess it’s analogous to having a var reference an element to the DOM, if the var no longer exists, the element still will, unless you call an element.removeChild(). You can also do a delete on elements in an array but again it will only delete the pointer to the object.
many thanks for your answers.
I got it
C74 RSS Feed | © Copyright Cycling '74