Browse Source

model disposing

Raanan Weber 7 years ago
parent
commit
8ee90520d0
1 changed files with 2 additions and 5 deletions
  1. 2 5
      Viewer/src/viewer/viewer.ts

+ 2 - 5
Viewer/src/viewer/viewer.ts

@@ -782,11 +782,8 @@ export abstract class AbstractViewer {
             if (!scene) return this.initScene();
 
             if (clearScene) {
-                scene.meshes.forEach(mesh => {
-                    if (Tags.MatchesQuery(mesh, "viewerMesh")) {
-                        mesh.dispose();
-                    }
-                });
+                this.models.forEach(m => m.dispose());
+                this.models.length = 0;
             }
             return scene!;
         }).then(() => {