Apply Fix 2: evict ModelCache on game exit, flush pending callbacks
Adds evict_all() to ModelCache which sets _shutting_down before flushing _pending with null callbacks, then clears _mem and _job_queue. This prevents in-flight HTTP completions from firing into a freed game scene and ensures each new game starts with a clean WASM heap. Called from game_screen._exit_tree() after all signal disconnections. Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude <noreply@anthropic.com> Co-Authored-By: Happy <yesreply@happy.engineering>
This commit is contained in:
@@ -377,6 +377,7 @@ func _exit_tree() -> void:
|
||||
_reset_unit_hover_glow()
|
||||
Chat.set_bubble_host(null)
|
||||
Chat.release_bubble_visibility(self)
|
||||
ModelCache.evict_all()
|
||||
|
||||
# ── State → scene orchestration ───────────────────────────────────────────────
|
||||
|
||||
|
||||
Reference in New Issue
Block a user