Skip to content

fix: Break retain cycle in CommandPalettePanel#112

Merged
2witstudios merged 1 commit intomainfrom
pu/fix-2
Mar 8, 2026
Merged

fix: Break retain cycle in CommandPalettePanel#112
2witstudios merged 1 commit intomainfrom
pu/fix-2

Conversation

@2witstudios
Copy link
Owner

Summary

  • The onSelect and onDismiss closures in CommandPalettePanel.show() captured panel strongly, while panel owned the view controller that stored those closures
  • This created a retain cycle (panelcontentViewControllerclosurespanel) that leaked memory every time the command palette was shown and dismissed
  • Fixed by using [weak panel] captures in both closures

Test plan

  • Open and dismiss the command palette multiple times — verify no memory growth in Instruments/Activity Monitor
  • Verify command palette selection still works (dismiss + callback fire correctly)
  • Verify escape-to-dismiss still works

🤖 Generated with Claude Code

The onSelect and onDismiss closures captured `panel` strongly while panel
owned the view controller that stored those closures, creating a cycle
(panel → vc → closures → panel) that leaked memory on every dismiss.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@chatgpt-codex-connector
Copy link

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@coderabbitai
Copy link

coderabbitai bot commented Mar 8, 2026

Warning

Rate limit exceeded

@2witstudios has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 17 minutes and 51 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: f8e359c5-6f23-4d24-bac6-4e2c79b07d8b

📥 Commits

Reviewing files that changed from the base of the PR and between 55aa882 and 83c7b96.

📒 Files selected for processing (1)
  • apps/purepoint-macos/purepoint-macos/Views/CommandPalette/CommandPalettePanel.swift
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch pu/fix-2

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@2witstudios
Copy link
Owner Author

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

🤖 Generated with Claude Code

- If this code review was useful, please react with 👍. Otherwise, react with 👎.

@2witstudios 2witstudios merged commit a33a4b8 into main Mar 8, 2026
2 checks passed
@2witstudios 2witstudios deleted the pu/fix-2 branch March 8, 2026 20:45
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.

1 participant