diff options
author | gdkchan <gab.dark.100@gmail.com> | 2023-01-14 00:16:06 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-14 00:16:06 -0300 |
commit | cd3a15aea514234153d0afcaaed0009086492bd9 (patch) | |
tree | dd4288a06b11a31bffd75a94d134126e23624dfd | |
parent | 070136b3f7a000e092eef46780091be29c0bc0bf (diff) |
Fix NRE when MemoryUnmappedHandler is called for a destroyed channel (#4285)1.1.554
-rw-r--r-- | Ryujinx.Graphics.Gpu/GpuChannel.cs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Ryujinx.Graphics.Gpu/GpuChannel.cs b/Ryujinx.Graphics.Gpu/GpuChannel.cs index fe858762..43fa8484 100644 --- a/Ryujinx.Graphics.Gpu/GpuChannel.cs +++ b/Ryujinx.Graphics.Gpu/GpuChannel.cs @@ -73,7 +73,7 @@ namespace Ryujinx.Graphics.Gpu // Since the memory manager changed, make sure we will get pools from addresses of the new memory manager. TextureManager.ReloadPools(); - MemoryManager.Physical.BufferCache.QueuePrune(); + memoryManager.Physical.BufferCache.QueuePrune(); } /// <summary> @@ -84,7 +84,9 @@ namespace Ryujinx.Graphics.Gpu private void MemoryUnmappedHandler(object sender, UnmapEventArgs e) { TextureManager.ReloadPools(); - MemoryManager.Physical.BufferCache.QueuePrune(); + + var memoryManager = Volatile.Read(ref _memoryManager); + memoryManager?.Physical.BufferCache.QueuePrune(); } /// <summary> |