Skip to content

Conversation

@sauerdaniel
Copy link
Contributor

@sauerdaniel sauerdaniel commented Jan 13, 2026

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

The Footer component's tick() function creates recursive timeouts but
only stores the most recent timeout ID. When the component unmounts,
only the last timeout is cleared - earlier ones continue running.

Track all timeout IDs in an array and clear them all in onCleanup()
to ensure proper cleanup on unmount.
@github-actions
Copy link
Contributor

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

@github-actions
Copy link
Contributor

The following comment was made by an LLM, it may be inaccurate:

No duplicate PRs found

@rekram1-node
Copy link
Collaborator

/review

@github-actions
Copy link
Contributor

lgtm

@rekram1-node rekram1-node merged commit 1ff46c7 into anomalyco:dev Jan 14, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Memory leak: Footer component only clears last timeout in recursive chain

2 participants