Procházet zdrojové kódy

Force releasing texture

Popov72 před 4 roky
rodič
revize
5c4dcebd0a

+ 5 - 5
nodeEditor/src/components/preview/previewManager.ts

@@ -460,7 +460,7 @@ export class PreviewManager {
                     }
                     }
 
 
                     if (this._material) {
                     if (this._material) {
-                        this._material.dispose();
+                        this._material.dispose(false, true);
                     }
                     }
                     this._material = tempMaterial;
                     this._material = tempMaterial;
                     break;
                     break;
@@ -471,7 +471,7 @@ export class PreviewManager {
                     this._proceduralTexture = tempMaterial.createProceduralTexture(512, this._scene);
                     this._proceduralTexture = tempMaterial.createProceduralTexture(512, this._scene);
 
 
                     if (this._material) {
                     if (this._material) {
-                        this._material.dispose();
+                        this._material.dispose(false, true);
                     }
                     }
 
 
                     if (this._layer) {
                     if (this._layer) {
@@ -495,7 +495,7 @@ export class PreviewManager {
                     tempMaterial.createEffectForParticles(this._particleSystem!);
                     tempMaterial.createEffectForParticles(this._particleSystem!);
 
 
                     if (this._material) {
                     if (this._material) {
-                        this._material.dispose();
+                        this._material.dispose(false, true);
                     }
                     }
                     this._material = tempMaterial;
                     this._material = tempMaterial;
                     break;
                     break;
@@ -512,7 +512,7 @@ export class PreviewManager {
                                 }
                                 }
 
 
                                 if (this._material) {
                                 if (this._material) {
-                                    this._material.dispose();
+                                    this._material.dispose(false, true);
                                 }
                                 }
 
 
                                 this._material = tempMaterial;
                                 this._material = tempMaterial;
@@ -545,7 +545,7 @@ export class PreviewManager {
         this._globalState.onLightUpdated.remove(this._onLightUpdatedObserver);
         this._globalState.onLightUpdated.remove(this._onLightUpdatedObserver);
 
 
         if (this._material) {
         if (this._material) {
-            this._material.dispose();
+            this._material.dispose(false, true);
         }
         }
 
 
         this._camera.dispose();
         this._camera.dispose();