Browse Source

Adding dispose for ReflectionProbe

David Catuhe 9 years ago
parent
commit
6e74305683

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


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


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

@@ -36332,6 +36332,10 @@ var BABYLON;
                 // Remove from the scene if found 
                 this._scene.reflectionProbes.splice(index, 1);
             }
+            if (this._renderTargetTexture) {
+                this._renderTargetTexture.dispose();
+                this._renderTargetTexture = null;
+            }
         };
         return ReflectionProbe;
     })();

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


+ 4 - 0
src/Probes/babylon.reflectionProbe.js

@@ -81,6 +81,10 @@ var BABYLON;
                 // Remove from the scene if found 
                 this._scene.reflectionProbes.splice(index, 1);
             }
+            if (this._renderTargetTexture) {
+                this._renderTargetTexture.dispose();
+                this._renderTargetTexture = null;
+            }
         };
         return ReflectionProbe;
     })();

+ 5 - 0
src/Probes/babylon.reflectionProbe.ts

@@ -89,6 +89,11 @@
                 // Remove from the scene if found 
                 this._scene.reflectionProbes.splice(index, 1);
             }            
+
+            if (this._renderTargetTexture) {
+                this._renderTargetTexture.dispose();
+                this._renderTargetTexture = null;
+            }
         }
     }    
 }