Selaa lähdekoodia

Fix infinite loop when disposing scene

Popov72 5 vuotta sitten
vanhempi
commit
ec5cd54c01
2 muutettua tiedostoa jossa 3 lisäystä ja 0 poistoa
  1. 1 0
      dist/preview release/what's new.md
  2. 2 0
      loaders/src/glTF/2.0/glTFLoader.ts

+ 1 - 0
dist/preview release/what's new.md

@@ -94,5 +94,6 @@
 - Fix bug in PBR when specific combinations of parameters are used ([Popov72](https://github.com/Popov72)
 - Fix texture being inverted on the Y axis by default when using TextureAsset or AssetManager ([broederj](https://github.com/broederj))
 - Fix `TexturePacker` cross-origin image requests, fix falsy default options ([ludevik](https://github.com/ludevik))
+- Fix freeze (infinite loop) when disposing a scene that loaded some specific gLTF files ([Popov72](https://github.com/Popov72)
 
 ## Breaking changes

+ 2 - 0
loaders/src/glTF/2.0/glTFLoader.ts

@@ -733,7 +733,9 @@ export class GLTFLoader implements IGLTFLoader {
             }));
         }
         else {
+            this._babylonScene._blockEntityCollection = this._forAssetContainer;
             node._babylonTransformNode = new TransformNode(name, this._babylonScene);
+            this._babylonScene._blockEntityCollection = false;
             node._primitiveBabylonMeshes = [];
             for (const primitive of primitives) {
                 promises.push(this._loadMeshPrimitiveAsync(`${context}/primitives/${primitive.index}`, `${name}_primitive${primitive.index}`, node, mesh, primitive, (babylonMesh) => {