clean_ryujinx/src
Babib3l e756ad4556 Fix ProcessLoader stale PID validation against kernel process table (#102)
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
2026-05-16 01:11:06 +00:00
..
ARMeilleure [ci skip] replace all usages of IntPtr with nint 2026-01-27 17:41:46 -06:00
Ryujinx Updated PlayReports for more titles (#93) 2026-05-14 04:06:28 +00:00
Ryujinx.Audio audio: Fix crash due to invalid Splitter size (ryubing/ryujinx!257) 2026-01-31 11:22:14 -06:00
Ryujinx.Audio.Backends.Apple fix AppleHardwareDeviceDriver.IsSupported (no fancy check is needed; it's on any macOS version 10.5 (Leopard) and above) 2026-01-28 00:05:02 -06:00
Ryujinx.Audio.Backends.OpenAL audio backend projects code cleanup 2026-01-27 17:34:51 -06:00
Ryujinx.Audio.Backends.SDL3 audio backend projects code cleanup 2026-01-27 17:34:51 -06:00
Ryujinx.Audio.Backends.SoundIo [ci skip] replace all usages of IntPtr with nint 2026-01-27 17:41:46 -06:00
Ryujinx.BuildValidationTasks Fixed spelling in LocalesValidationTask.cs (ryubing/ryujinx!269) 2026-02-21 04:37:02 -06:00
Ryujinx.Common Updated PlayReports for more titles (#93) 2026-05-14 04:06:28 +00:00
Ryujinx.Cpu [CPU] Increased base JIT cache size (#22) 2026-05-02 02:49:59 +00:00
Ryujinx.Graphics.Device
Ryujinx.Graphics.GAL Add shader non-uniform indexing support (#91) 2026-05-14 08:59:10 +00:00
Ryujinx.Graphics.Gpu Add shader non-uniform indexing support (#91) 2026-05-14 08:59:10 +00:00
Ryujinx.Graphics.Host1x
Ryujinx.Graphics.Nvdec
Ryujinx.Graphics.Nvdec.FFmpeg
Ryujinx.Graphics.Nvdec.Vp9
Ryujinx.Graphics.OpenGL Add shader non-uniform indexing support (#91) 2026-05-14 08:59:10 +00:00
Ryujinx.Graphics.RenderDocApi RenderDoc API support (ryubing/ryujinx!242) 2026-01-01 00:10:21 -06:00
Ryujinx.Graphics.Shader Change non-unform shader extension to be more conservative (#99) 2026-05-15 15:19:12 +00:00
Ryujinx.Graphics.Texture
Ryujinx.Graphics.Vic
Ryujinx.Graphics.Video
Ryujinx.Graphics.Vulkan Fix Vulkan validation errors (#92) 2026-05-15 15:36:14 +00:00
Ryujinx.HLE Fix ProcessLoader stale PID validation against kernel process table (#102) 2026-05-16 01:11:06 +00:00
Ryujinx.HLE.Generators
Ryujinx.Horizon Accurate Service Names (ryubing/ryujinx!296) 2026-04-01 11:08:10 -05:00
Ryujinx.Horizon.Common
Ryujinx.Horizon.Generators
Ryujinx.Horizon.Kernel.Generators
Ryujinx.Input Input: Implement HD Rumble for compatible Nin devices (#40) 2026-05-13 23:57:30 +00:00
Ryujinx.Input.SDL3 Input: Implement HD Rumble for compatible Nin devices (#40) 2026-05-13 23:57:30 +00:00
Ryujinx.Memory [ci skip] replace all usages of IntPtr with nint 2026-01-27 17:41:46 -06:00
Ryujinx.SDL3.Common revert b7f42de5a6 (#46) 2026-05-02 01:03:53 +00:00
Ryujinx.ShaderTools
Ryujinx.Tests [HLE] Match hardware screenshot buffer size behavior for captures (#44) 2026-05-10 23:57:05 +00:00
Ryujinx.Tests.Memory feature: .NET 10 (ryubing/ryujinx!214) 2025-11-11 12:55:36 -06:00
Ryujinx.Tests.Unicorn
Ryujinx.UI.LocaleGenerator Fractured Locales Support (ryubing/ryujinx!238) 2025-12-27 14:07:56 -06:00
Spv.Generator