Browse Source

Merge pull request #21159 from Mugen87/dev51

Editor: Call dispose() on textures.
Mr.doob 4 years ago
parent
commit
bd095516a1
1 changed files with 2 additions and 0 deletions
  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;