Skip to content

Fix: resolve memory leaks and remove debug info leakage#346

Open
rm335 wants to merge 1 commit intodwarvesf:developfrom
rm335:fix/memory-leaks-and-security-cleanup
Open

Fix: resolve memory leaks and remove debug info leakage#346
rm335 wants to merge 1 commit intodwarvesf:developfrom
rm335:fix/memory-leaks-and-security-cleanup

Conversation

@rm335
Copy link

@rm335 rm335 commented Mar 13, 2026

Summary

  • Remove debug print(keyCode) in GlobalKeybindingPreferences.description that leaked user hotkey data to the
    system console
  • Add removeObserver(self) in LauncherApplication/AppDelegate.applicationWillTerminate
    DistributedNotificationCenter does not use zeroing-weak references, so unremoved observers risk a crash on dealloc
  • Add deinit with removeObserver(self) to PreferencesViewController — observer registered in viewDidLoad had
    no cleanup path
  • Use [weak self] in two DispatchQueue.main.asyncAfter closures in StatusBarController to prevent retaining
    self beyond intended lifetime

Test plan

  • Verify global hotkey still works after setting it in Preferences
  • Open and close Preferences window multiple times, confirm no observer accumulation (use Instruments Allocations)
  • Confirm LauncherApplication terminates cleanly without console crash logs
  • Confirm auto-collapse timer still fires correctly after expanding the menu bar
  • Verify no keyCode output appears in Console.app during normal usage

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