Skip to content

Support fast exit to speed up application shutdown#211

Merged
gameknife merged 2 commits intomainfrom
feature/fast-exit-14075704582197301851
Jan 13, 2026
Merged

Support fast exit to speed up application shutdown#211
gameknife merged 2 commits intomainfrom
feature/fast-exit-14075704582197301851

Conversation

@google-labs-jules
Copy link
Copy Markdown
Contributor

This change addresses issue #210 by introducing a "fast exit" mechanism. By default, the engine will no longer wait for all background tasks to complete upon exit. Instead, it performs essential cleanup (like saving localization data) and then immediately terminates the process using std::quick_exit, skipping the lengthy destruction of static objects and thread synchronization. This behavior can be disabled with --fastexit=false.


PR created automatically by Jules for task 14075704582197301851 started by @gameknife

- Add `--fastexit` CLI option (default: true).
- Skip waiting for background tasks in `NextEngine::End` when fast exit is enabled.
- Move `SaveLocTexts` to `NextEngine::End` to ensure data persistence before exit.
- Use `std::quick_exit(0)` in `SDL_AppQuit` to bypass static destructors for rapid shutdown.
@google-labs-jules
Copy link
Copy Markdown
Contributor Author

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@gameknife
Copy link
Copy Markdown
Owner

目前run.bat好像也会导致残留,现象是关闭程序后,command始终没有恢复,这个问题也需要解决

@google-labs-jules
Copy link
Copy Markdown
Contributor Author

目前run.bat好像也会导致残留,现象是关闭程序后,command始终没有恢复,这个问题也需要解决

I have updated run.ps1 to use the call operator & instead of Start-Process. This should resolve the issue where the command prompt doesn't recover after the program exits, as it executes the process directly in the current shell context rather than spawning a monitored child process that might not be signaling exit correctly in this scenario.

- Add `--fastexit` CLI option (default: true).
- Skip waiting for background tasks in `NextEngine::End` when fast exit is enabled.
- Move `SaveLocTexts` to `NextEngine::End` to ensure data persistence before exit.
- Use `std::quick_exit(0)` in `SDL_AppQuit` to bypass static destructors for rapid shutdown.
- Update `run.ps1` to use direct call operator `&` instead of `Start-Process` to fix console restoration issue.
@gameknife gameknife marked this pull request as ready for review January 13, 2026 12:19
@gameknife gameknife merged commit f0df4be into main Jan 13, 2026
5 checks passed
@gameknife gameknife deleted the feature/fast-exit-14075704582197301851 branch January 14, 2026 10:14
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