The current implementation of IFCManager.close in IFCManager.ts leaks memory, because IFCModel is not disposed properly in a threejs-way.
/**
* Closes the specified model and deletes it from the [scene](https://threejs.org/docs/#api/en/scenes/Scene).
* @modelID ID of the IFC model.
* @scene Scene where the model is (if it's located in a scene).
*/
close(modelID: number, scene?: Scene) {
this.state.api.CloseModel(modelID);
if (scene) scene.remove(this.state.models[modelID].mesh);
// this.state.models[modelID].mesh.geometry.dispose() & this.state.models[modelID].mesh.material.dispose()
// should be called here, before deleting reference
delete this.state.models[modelID];
}
The current implementation of
IFCManager.close
in IFCManager.ts leaks memory, becauseIFCModel
is not disposed properly in a threejs-way.