Browse Source

Editor: Call dispose() on textures.

Mugen87 4 năm trước cách đây
mục cha
commit
1cba5459ae
1 tập tin đã thay đổi với 2 bổ sung0 xóa
  1. 2 0
      editor/js/commands/SetMaterialMapCommand.js

+ 2 - 0
editor/js/commands/SetMaterialMapCommand.js

@@ -31,6 +31,8 @@ SetMaterialMapCommand.prototype = {
 
 	execute: function () {
 
+		if ( this.oldMap !== null && this.oldMap !== undefined ) this.oldMap.dispose();
+
 		this.material[ this.mapName ] = this.newMap;
 		this.material.needsUpdate = true;