Jelajahi Sumber

Editor: Call dispose() on textures.

Mugen87 4 tahun lalu
induk
melakukan
1cba5459ae
1 mengubah file dengan 2 tambahan dan 0 penghapusan
  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;