瀏覽代碼

Remove leak from fallbacks

David Catuhe 8 年之前
父節點
當前提交
6d4b3de9e7

File diff suppressed because it is too large
+ 2228 - 2227
dist/preview release/babylon.d.ts


File diff suppressed because it is too large
+ 5 - 5
dist/preview release/babylon.js


+ 11 - 0
dist/preview release/babylon.max.js

@@ -23979,6 +23979,9 @@ var BABYLON;
             this._currentRank = 32;
             this._maxRank = -1;
         }
+        EffectFallbacks.prototype.unBindMesh = function () {
+            this._mesh = null;
+        };
         EffectFallbacks.prototype.addFallback = function (rank, define) {
             if (!this._defines[rank]) {
                 if (rank < this._currentRank) {
@@ -24415,6 +24418,10 @@ var BABYLON;
                 }
                 this.onCompileObservable.notifyObservers(this);
                 this.onCompileObservable.clear();
+                // Unbind mesh reference in fallbacks
+                if (this._fallbacks) {
+                    this._fallbacks.unBindMesh();
+                }
             }
             catch (e) {
                 this._compilationError = e.message;
@@ -24439,6 +24446,10 @@ var BABYLON;
                     }
                     this.onErrorObservable.notifyObservers(this);
                     this.onErrorObservable.clear();
+                    // Unbind mesh reference in fallbacks
+                    if (this._fallbacks) {
+                        this._fallbacks.unBindMesh();
+                    }
                 }
             }
         };

File diff suppressed because it is too large
+ 2228 - 2227
dist/preview release/babylon.module.d.ts


File diff suppressed because it is too large
+ 5 - 5
dist/preview release/babylon.worker.js


File diff suppressed because it is too large
+ 4723 - 4722
dist/preview release/customConfigurations/minimalGLTFViewer/babylon.d.ts


File diff suppressed because it is too large
+ 9 - 9
dist/preview release/customConfigurations/minimalGLTFViewer/babylon.js


+ 11 - 0
dist/preview release/customConfigurations/minimalGLTFViewer/babylon.max.js

@@ -23979,6 +23979,9 @@ var BABYLON;
             this._currentRank = 32;
             this._maxRank = -1;
         }
+        EffectFallbacks.prototype.unBindMesh = function () {
+            this._mesh = null;
+        };
         EffectFallbacks.prototype.addFallback = function (rank, define) {
             if (!this._defines[rank]) {
                 if (rank < this._currentRank) {
@@ -24415,6 +24418,10 @@ var BABYLON;
                 }
                 this.onCompileObservable.notifyObservers(this);
                 this.onCompileObservable.clear();
+                // Unbind mesh reference in fallbacks
+                if (this._fallbacks) {
+                    this._fallbacks.unBindMesh();
+                }
             }
             catch (e) {
                 this._compilationError = e.message;
@@ -24439,6 +24446,10 @@ var BABYLON;
                     }
                     this.onErrorObservable.notifyObservers(this);
                     this.onErrorObservable.clear();
+                    // Unbind mesh reference in fallbacks
+                    if (this._fallbacks) {
+                        this._fallbacks.unBindMesh();
+                    }
                 }
             }
         };

File diff suppressed because it is too large
+ 4723 - 4722
dist/preview release/customConfigurations/minimalGLTFViewer/babylon.module.d.ts


+ 14 - 0
src/Materials/babylon.effect.ts

@@ -8,6 +8,10 @@
         private _mesh: AbstractMesh;
         private _meshRank: number;
 
+        public unBindMesh() {
+            this._mesh = null;
+        }
+
         public addFallback(rank: number, define: string): void {
             if (!this._defines[rank]) {
                 if (rank < this._currentRank) {
@@ -539,6 +543,11 @@
                 }
                 this.onCompileObservable.notifyObservers(this);
                 this.onCompileObservable.clear();
+
+                // Unbind mesh reference in fallbacks
+                if (this._fallbacks) {
+                    this._fallbacks.unBindMesh();
+                }
             } catch (e) {
                 this._compilationError = e.message;
 
@@ -564,6 +573,11 @@
                     }
                     this.onErrorObservable.notifyObservers(this);
                     this.onErrorObservable.clear();
+
+                    // Unbind mesh reference in fallbacks
+                    if (this._fallbacks) {
+                        this._fallbacks.unBindMesh();
+                    }
                 }
             }            
         }