Subscribe to a material's dispose event so the manager can clean
up its registry entries automatically. THREE.Material's
EventDispatcher fires dispose synchronously inside dispose(),
so by the time super.dispose() returns, the manager has already
forgotten about this material.
Wiring cleanup this way (manager → material) instead of having
materials call back into the manager avoids an import cycle
between material-manager.ts and the per-geometry material modules.
Subscribe to a material's
disposeevent so the manager can clean up its registry entries automatically. THREE.Material's EventDispatcher firesdisposesynchronously insidedispose(), so by the timesuper.dispose()returns, the manager has already forgotten about this material.Wiring cleanup this way (manager → material) instead of having materials call back into the manager avoids an import cycle between material-manager.ts and the per-geometry material modules.