[PR #8255] fix(tui): track all timeouts in Footer to prevent memory leak #12679

Closed
opened 2026-02-16 18:17:34 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/8255

State: closed
Merged: Yes


Summary

Fix memory leak in Footer component where only the last timeout in a recursive chain is tracked and cleared.

Problem

In packages/tui/src/components/footer/index.tsx, the recursive blink() function creates a chain of timeouts but only stores the most recent one in blinkTimeout. When the component unmounts:

  • Only the last timeout gets cleared
  • Earlier timeouts in the chain continue executing
  • References to unmounted component state persist

Solution

  • Track all created timeouts in an array (blinkTimeouts)
  • Clear all timeouts on unmount
  • Prevents orphaned timeout chains

Fixes #8259

**Original Pull Request:** https://github.com/anomalyco/opencode/pull/8255 **State:** closed **Merged:** Yes --- ## Summary Fix memory leak in Footer component where only the last timeout in a recursive chain is tracked and cleared. ## Problem In `packages/tui/src/components/footer/index.tsx`, the recursive `blink()` function creates a chain of timeouts but only stores the most recent one in `blinkTimeout`. When the component unmounts: - Only the last timeout gets cleared - Earlier timeouts in the chain continue executing - References to unmounted component state persist ## Solution - Track all created timeouts in an array (`blinkTimeouts`) - Clear all timeouts on unmount - Prevents orphaned timeout chains Fixes #8259
yindo added the pull-request label 2026-02-16 18:17:34 -05:00
yindo closed this issue 2026-02-16 18:17:34 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#12679