Tear down every subsystem an init() pass could have constructed.
Component order is the teardown contract: animation first (so the
loop stops emitting events before listeners disappear); overlays /
picking / browser before input-handler (those routes wire through
the input handler); scene-manager + theme-manager + cleanupUI
between component teardown and singleton teardown; data-monitor,
scene-loader, worker-pool last because earlier components hold
loader/worker references the singletons own.
Each step is wrapped in safeDispose; a throwing component must NOT
skip later cleanup (especially singletons + workers + the manager
registry). Errors collect and log without bubbling.
Tear down every subsystem an init() pass could have constructed.
Component order is the teardown contract: animation first (so the loop stops emitting events before listeners disappear); overlays / picking / browser before input-handler (those routes wire through the input handler); scene-manager + theme-manager + cleanupUI between component teardown and singleton teardown; data-monitor, scene-loader, worker-pool last because earlier components hold loader/worker references the singletons own.
Each step is wrapped in safeDispose; a throwing component must NOT skip later cleanup (especially singletons + workers + the manager registry). Errors collect and log without bubbling.