mirror of
https://git.naxdy.org/Mirror/Ryujinx.git
synced 2026-05-17 02:31:55 +00:00
This PR adresses the following issue : `ProcessLoader.ActiveApplication` could return invalid results when `_latestPid` pointed to a process that no longer existed in the kernel's process table. The original exception path was commented out and bypassed (by sh0inx?) with `GetValueOrDefault` to prevent UI lockups, but this only resolved the symptoms without fixing the root cause. This was due to sevral factors : - `_latestPid` was never reset or validated against the actual process state - ProcessLoader maintained its own `_processesByPid` dictionary separate from the kernel's `KernelContext.Processes` - No cleanups happened when processes exited or were terminated - ProcessLoader state could drift out of sync with the kernel process table **Solution/Fixes** - Validate` _latestPid` against the kernel process table before returning `ActiveApplication` - Check process state (Exited/Exiting) and automatically clear stale references - Add thread-safe cleanup methods (`ClearProcess`, `ClearAllProcesses`) - Integrate `ClearAllProcesses` into Switch.Dispose for proper shutdown cleanup - Add warning logs when stale PID is detected and cleared for debugging **Code Changes**: - `ProcessLoader.cs`: Add `_pidLock`, update `ActiveApplication` with validation, add cleanup methods - `Switch.cs`: Call `Processes.ClearAllProcesses()` in Dispose() Reviewed-on: https://git.ryujinx.app/projects/Ryubing/pulls/102 |
||
|---|---|---|
| .. | ||
| ARMeilleure | ||
| Ryujinx | ||
| Ryujinx.Audio | ||
| Ryujinx.Audio.Backends.Apple | ||
| Ryujinx.Audio.Backends.OpenAL | ||
| Ryujinx.Audio.Backends.SDL3 | ||
| Ryujinx.Audio.Backends.SoundIo | ||
| Ryujinx.BuildValidationTasks | ||
| Ryujinx.Common | ||
| Ryujinx.Cpu | ||
| Ryujinx.Graphics.Device | ||
| Ryujinx.Graphics.GAL | ||
| Ryujinx.Graphics.Gpu | ||
| Ryujinx.Graphics.Host1x | ||
| Ryujinx.Graphics.Nvdec | ||
| Ryujinx.Graphics.Nvdec.FFmpeg | ||
| Ryujinx.Graphics.Nvdec.Vp9 | ||
| Ryujinx.Graphics.OpenGL | ||
| Ryujinx.Graphics.RenderDocApi | ||
| Ryujinx.Graphics.Shader | ||
| Ryujinx.Graphics.Texture | ||
| Ryujinx.Graphics.Vic | ||
| Ryujinx.Graphics.Video | ||
| Ryujinx.Graphics.Vulkan | ||
| Ryujinx.HLE | ||
| Ryujinx.HLE.Generators | ||
| Ryujinx.Horizon | ||
| Ryujinx.Horizon.Common | ||
| Ryujinx.Horizon.Generators | ||
| Ryujinx.Horizon.Kernel.Generators | ||
| Ryujinx.Input | ||
| Ryujinx.Input.SDL3 | ||
| Ryujinx.Memory | ||
| Ryujinx.SDL3.Common | ||
| Ryujinx.ShaderTools | ||
| Ryujinx.Tests | ||
| Ryujinx.Tests.Memory | ||
| Ryujinx.Tests.Unicorn | ||
| Ryujinx.UI.LocaleGenerator | ||
| Spv.Generator | ||