Skip to content

Renderer: Fix edge cases in dispose(). - #34765

Merged
Mugen87 merged 1 commit into
mrdoob:devfrom
Mugen87:dev3
Oct 3, 2026
Merged

Mugen87 merged 1 commit into
mrdoob:devfrom
Mugen87:dev3

Conversation

@Mugen87

@Mugen87 Mugen87 commented Oct 3, 2026

Copy link
Copy Markdown
Collaborator

Fixed #34756.

Description

The PR fixes a two edge cases in Renderer.dispose():

  • dispose() is called with a never initialized renderer.
  • dispose() is called during a pending init.

When the init throws, the renderer is in an undefined state so a deterministic disposal isn't possible. The method now rejects so the app can react on it.

@github-actions

github-actions Bot commented Oct 3, 2026

Copy link
Copy Markdown

πŸ“¦ Bundle size

Full ESM build, minified and gzipped.

Before After Diff
Core 390.06
102.33
390.06
102.33
+0 B
+0 B
WebGL 372.97
87.24
372.97
87.24
+0 B
+0 B
WebGPU 429.87
115.86
429.92
115.87
+41 B
+7 B
WebGPU Nodes 718.15
197.34
718.19
197.35
+41 B
+13 B

🌳 Bundle size after tree-shaking

Minimal build including a renderer, camera, empty scene, and dependencies.

Before After Diff
WebGL 517.7
124.36
517.7
124.36
+0 B
+0 B
WebGPU 770.13
206.44
770.17
206.45
+41 B
+9 B
WebGPU Nodes 715.98
192.95
716.02
192.97
+41 B
+17 B

@Mugen87 Mugen87 added this to the r187 milestone Oct 3, 2026
@Mugen87
Mugen87 merged commit 559a928 into mrdoob:dev Oct 3, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Disposal after failed renderer initialisation starts initialisation again

1 participant