-
-
Notifications
You must be signed in to change notification settings - Fork 118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix quitting freeze #1875
Fix quitting freeze #1875
Conversation
WalkthroughThis pull request updates the project's version control and core functionality. In the Changes
Sequence Diagram(s)sequenceDiagram
participant GUI as GUI Component
participant Temp as Temporary File
participant Config as Configuration File
GUI->>Temp: Write configuration data
GUI->>Config: Copy temp file to main config
Config-->>GUI: Overwrite existing file
GUI->>Temp: Delete temporary file
sequenceDiagram
participant OS as Operating System
participant SignalHandler as Signal Handler
participant Main as Main Loop
OS->>SignalHandler: Send SIGINT/SIGTERM
SignalHandler->>Main: Set scheduledQuit flag to true
Main->>Main: Check scheduledQuit flag during loop
Main->>Cleanup: Initiate quit and perform cleanup
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: .coderabbit.yaml 📒 Files selected for processing (3)
🧰 Additional context used🪛 GitHub Check: CodeScene Cloud Delta Analysis (main)src/main/main.cc[warning] 196-461: ❌ Getting worse: Complex Method [warning] 196-461: ❌ Getting worse: Complex Method ⏰ Context from checks skipped due to timeout of 90000ms (12)
🔇 Additional comments (5)
✨ Finishing Touches
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
I've always had an issue where trying to close pcsx-redux by pressing Ctrl+C on the terminal (i.e. SIGINT) would make the app hang. It was trying to save settings, but got stuck in glfwGetWindowAttrib, probably a deadlock. This fixes that by moving the quit call into the main loop rather than the signal handler itself.
I've also randomly lost my settings when trying to quit, so I also made it prevent that by writing into pcsx.json.tmp and then moving it into pcsx.json, rather than writing into pcsx.json right away. I'm not sure what exactly caused the data loss, maybe it's related to the issues above, but this should help.