Fix duplicate instances remaining after update - #795
Conversation
|
The PR Policy check is blocking this PR because required template information is missing. Please update the PR description with:
Screenshots or video are required for UI, UX, settings, onboarding, overlay, menu bar, or visual behavior changes. If this PR has no visual changes, check the no-visual-change box in the template. If this remains incomplete for 48 hours after opening, the PR may be closed. |
Greptile SummaryThe PR moves the updater’s fallback watchdog ahead of
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3bc418acc8
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
… a fallback exit(0)
…lay to allow AppKit cleanup to finish
…ate to ensure it schedules before termination blocks the main thread
|
Thanks for the PR. I'm not sure if killing it forcefully will remove the memory occupied by models that FluidVoice loads. Did you happen to take a look at that? In the current update I added a waiter so it waits to make sure the update happens clearly so - from next update it should fix this better |
|
Thanks for taking a look! RE: memory: yes, even if the process is forcefully killed, the macOS kernel will completely reclaim all unified memory and MLX buffers assigned to that PID. It won't cause a system-level memory leak. However, with the latest commits on this PR, the That being said, if you've already implemented a proper waiter in the upcoming release that handles the update lifecycle more cleanly, feel free to just close this PR! I mainly wanted to get a safety net in place because the duplicate background instances were causing global hotkey collisions on my machine. |
|
Thanks a lot @sfasano - let's try my current method to see if it fixes it - if not we'll come work on this together :) PS : we're also workin on a new updater to solve all this. That will solve all of the current issues. Really appreciate your support in this :) |
Description
Replaced
NSApp.terminate(nil)withexit(0)inSimpleUpdater.swift. This ensures the old instance forcefully quits after launching the new application instance, preventing a race condition where duplicate processes run simultaneously and fight over the global hotkey and microphone.Type of Change
Related Issue or Discussion
Closes #794
Testing
swiftlint --strict --config .swiftlint.yml Sourcesswiftformat --config .swiftformat SourcesScreenshots / Video
Notes
The
exit(0)call prevents the application from lingering in the background if the runloop is blocked during an update.