mirror of
https://github.com/galacean/engine.git
synced 2026-06-21 09:26:05 +08:00
The per-frame disposeUsedElements from the previous commit cleared target/currentTarget too eagerly: code that saved an eventData and read it in the same frame's onUpdate got null, and after pause the refs lingered anyway. No major engine does per-frame dispose (DOM/Pixi/Unity all defer cleanup to reuse). Revert to clear-on-reuse, and instead hook the pool into engine gc (PointerManager._gc -> InputManager._gc -> Engine._gc) like the render element pools, so peak memory and entity refs are reclaimed on gc and at destroy. Add a test for pool reclamation on gc. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>