Browse Source

model disposing

Raanan Weber 7 năm trước cách đây
mục cha
commit
8ee90520d0
1 tập tin đã thay đổi với 2 bổ sung5 xóa
  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(() => {