소스 검색

Editor: Call dispose() on textures.

Mugen87 4 년 전
부모
커밋
1cba5459ae
1개의 변경된 파일2개의 추가작업 그리고 0개의 파일을 삭제
  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;