fix: prevent memory leaks on consecutive fight replays

- FightViewer: store canvas event handlers and remove them before
  replacing canvas elements, preventing detached DOM/closure leaks
- FightViewer: clean up canvas listeners on unmount
- tts.ts: clear _staticLoading dedup map after precache completes

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Dorian
2026-03-13 10:04:03 +00:00
co-authored by Claude Opus 4.6
parent aa263ec8ae
commit 854b1cd1df
2 changed files with 23 additions and 4 deletions
+2
View File
@@ -358,6 +358,8 @@ async function _precacheCommon() {
}
_precacheDone = true
_precacheRunning = false
// Release dedup promises — they hold closures referencing fetch/decode state
_staticLoading.clear()
}
function _cacheKey(text: string, profile: string): string {