From 880d23ea380328ba288a381a3084b109c12cf2ec Mon Sep 17 00:00:00 2001 From: Michael Herzog Date: Fri, 3 Jan 2025 14:03:27 +0100 Subject: [PATCH] WebGLBackground: Reset meshes in `dispose()`. (#30257) --- src/renderers/webgl/WebGLBackground.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/renderers/webgl/WebGLBackground.js b/src/renderers/webgl/WebGLBackground.js index 1344ac8ac4f8db..9abfdb09a4a155 100644 --- a/src/renderers/webgl/WebGLBackground.js +++ b/src/renderers/webgl/WebGLBackground.js @@ -249,6 +249,8 @@ function WebGLBackground( renderer, cubemaps, cubeuvmaps, state, objects, alpha, boxMesh.geometry.dispose(); boxMesh.material.dispose(); + boxMesh = undefined; + } if ( planeMesh !== undefined ) { @@ -256,6 +258,8 @@ function WebGLBackground( renderer, cubemaps, cubeuvmaps, state, objects, alpha, planeMesh.geometry.dispose(); planeMesh.material.dispose(); + planeMesh = undefined; + } }