提交 fdea8942 编写于 作者: M Mr.doob

More disposing.

上级 96fd7a94
......@@ -88,7 +88,9 @@
// clean up
geometry.dispose();
material.dispose();
texture.dispose();
mesh.dispose();
}
......
......@@ -39,7 +39,7 @@ THREE.EventDispatcher = function () {
var listenerArray = listeners[ event.type ];
if ( listenerArray !== undefined ) {
event.target = this;
for ( var i = 0, l = listenerArray.length; i < l; i ++ ) {
......@@ -52,4 +52,4 @@ THREE.EventDispatcher = function () {
};
};
\ No newline at end of file
};
......@@ -740,6 +740,12 @@ THREE.Geometry.prototype = {
this.dispatchEvent( { type: 'dispose' } );
for ( var property in this ) {
delete this[ property ];
}
}
};
......
......@@ -349,6 +349,16 @@ THREE.Object3D.prototype = {
return object;
},
dispose: function () {
for ( var property in this ) {
delete this[ property ];
}
}
};
......
......@@ -120,6 +120,12 @@ THREE.Material.prototype.dispose = function () {
this.dispatchEvent( { type: 'dispose' } );
for ( var property in this ) {
delete this[ property ];
}
};
THREE.MaterialIdCount = 0;
......@@ -81,6 +81,12 @@ THREE.Texture.prototype = {
this.dispatchEvent( { type: 'dispose' } );
for ( var property in this ) {
delete this[ property ];
}
}
};
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册