From 1cba5459aee997f3a11e3c8a027f015def0f20f0 Mon Sep 17 00:00:00 2001 From: Mugen87 Date: Wed, 27 Jan 2021 13:22:04 +0100 Subject: [PATCH] Editor: Call dispose() on textures. --- editor/js/commands/SetMaterialMapCommand.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/editor/js/commands/SetMaterialMapCommand.js b/editor/js/commands/SetMaterialMapCommand.js index c911d33b8ddb40..8c6d33b7718b6d 100644 --- a/editor/js/commands/SetMaterialMapCommand.js +++ b/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;