Hi,
just found one case when Scene.dispose() enters infinite loop, have to kill either script of browser - when scene contains a transform node that contains an instance!
Here’s what happens then in Scene.dispose():
while (this.transformNodes.length) {
this.transformNodes[0].dispose(true);
}
That node becomes disposed, but is not removed from the transformNodes array, and this loop never ends.
I actually dispose() source to implement workaround:
// CHECKME: WORKAROUND
var i = 0;
while (i < scene.transformNodes.length) {
console.log("Disposing transformNode "+i+"/"+scene.transformNodes.length);
if ( scene.transformNodes[i].isDisposed() ) {
i++;
}
console.log(scene.transformNodes[i]);
scene.transformNodes[i].dispose(true);
}
To see the output, go to www.vrspace.org, choose avatar, choose the portal, look at javascript console.
The source is here: vrspace/avatar-selection.js at master · jalmasi/vrspace · GitHub