From a95c34ce923a3631ffdfce9a15b861d4bb2d70da Mon Sep 17 00:00:00 2001 From: Richard Davey Date: Wed, 17 Feb 2021 13:10:10 +0000 Subject: [PATCH] `WebGLRenderer.deleteTexture` will now run `resetTextures(true)` first, incase the requested texture to be deleted is currently bound. Previously, it would delete the texture and then reset them. --- src/renderer/webgl/WebGLRenderer.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/renderer/webgl/WebGLRenderer.js b/src/renderer/webgl/WebGLRenderer.js index c3cf5edd5..1a486b164 100644 --- a/src/renderer/webgl/WebGLRenderer.js +++ b/src/renderer/webgl/WebGLRenderer.js @@ -2173,16 +2173,16 @@ var WebGLRenderer = new Class({ */ deleteTexture: function (texture, reset) { + if (reset) + { + this.resetTextures(true); + } + if (texture) { this.gl.deleteTexture(texture); } - if (reset) - { - this.resetTextures(); - } - return this; },