-
-
Notifications
You must be signed in to change notification settings - Fork 36.1k
Closed
Description
Description of the problem
We noticed this first here: https://codesandbox.io/s/react-three-fiber-blob-qv9ww?from-embed
Go anywhere in the code and make a new line by hitting enter, it compiles then crashes (in the browser console). This happens because components unmount and dispose is called on the effect.
Plain JS example:
import * as THREE from 'three'
import { SSAOPass } from 'three/examples/jsm/postprocessing/SSAOPass'
const s = new THREE.Scene()
const c = new THREE.Camera()
const q = new SSAOPass(s,c)
q.dispose() // crashSSAOPass tries to dispose some quad, but that quad is neither part of SSAOPass, nor Pass, looks to me like a leftover.
this.quad.geometry.dispose(); // dispose materialsSSAOPass.js:138 Uncaught TypeError: Cannot read property 'geometry' of undefined
at SSAOPass.dispose (SSAOPass.js:138)
I thought about making a PR but wasn't sure, maybe this quad does belong in there and comes from somewhere else?