Explorar el Código

Editor: Call dispose() on textures.

Mugen87 hace 4 años
padre
commit
1cba5459ae
Se han modificado 1 ficheros con 2 adiciones y 0 borrados
  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;