Browse Source

Added deallocate() as per discussion in 05cbaf5a3324d5770b8f52c0a3fc886344d8b932

Mr.doob 13 years ago
parent
commit
f9d9b88f00
4 changed files with 24 additions and 0 deletions
  1. 6 0
      src/core/Geometry.js
  2. 6 0
      src/core/Object3D.js
  3. 6 0
      src/materials/Material.js
  4. 6 0
      src/textures/Texture.js

+ 6 - 0
src/core/Geometry.js

@@ -673,6 +673,12 @@ THREE.Geometry.prototype = {
 
 		// TODO
 
+	},
+
+	deallocate: function () {
+
+		THREE.GeometryLib[ this.id ] = null;
+
 	}
 
 };

+ 6 - 0
src/core/Object3D.js

@@ -343,6 +343,12 @@ THREE.Object3D.prototype = {
 
 		return object;
 
+	},
+
+	deallocate: function () {
+
+		THREE.Object3DLib[ this.id ] = null;
+
 	}
 
 };

+ 6 - 0
src/materials/Material.js

@@ -116,4 +116,10 @@ THREE.Material.prototype.clone = function ( material ) {
 
 };
 
+THREE.Material.prototype.deallocate = function () {
+
+	THREE.MaterialLib[ this.id ] = null;
+
+};
+
 THREE.MaterialLib = [];

+ 6 - 0
src/textures/Texture.js

@@ -69,6 +69,12 @@ THREE.Texture.prototype = {
 
 		return texture;
 
+	},
+
+	deallocate: function () {
+
+		THREE.TextureLib[ this.id ] = null;
+
 	}
 
 };