citra
citra copied to clipboard
kernel: Improvements to process cleanup.
- Reorganize ExitProcess code to be a bit cleaner and reusable for TerminateProcess.
- Fixes to termination of threads on process exit:
- Terminate threads on all cores.
- Make sure terminated threads are removed from the thread_list so they can be released.
- Allow terminating non-waiting threads. This is probably not exactly how the real kernel does it, so I've left a TODO item, but it works for the most part. Better to work at least some of the time than always fail the assert.
- Clean up lingering memory allocations on process destruction.
- Resolves cases where opening a game after closing another would attempt bogus linear heap allocations, due to incorrect resource limit memory commit values and a lack of free memory in the application region.
- Implement home menu path for APT:DoApplicationJump, which works now with the above changes.
With these changes a number of games (e.g. Super Mario 3D Land, Pokemon Mystery Dungeon: Gates to Infinity) can be quit and re-launched from the home menu instead of crashing.