I am using Angular 6 with three.js. I am also destroying mesh in ngOnDestroy.
ngOnDestroy() {
for (var i = this.model.children.length - 1; i >= 0; i--) {
console.log(this.model.children[i].name);
this.model.children[i].material.map.dispose();
this.model.children[i].geometry.dispose();
this.model.children[i].material.dispose();
this.model.remove(this.model.children[i]);
}
this.scene.remove(this.model);
this.model.dispose();
this.model = [];
window.cancelAnimationFrame(this.animateRequest);
}
But out of memory error is still there.
Also, while the 3D model is loading, the whole screen in IE freezes for that time and any angular ngModel update is not reflected in the view. I have tried console.log statements, which actually are visible.