From dd8f97ab9e77dde25c323feaff97cfc8f19207fa Mon Sep 17 00:00:00 2001
From: gdkchan <gab.dark.100@gmail.com>
Date: Sun, 5 Jun 2022 15:12:42 -0300
Subject: Remove freed memory range from tree on memory block disposal (#3347)

* Remove freed memory range from tree on memory block disposal

* PR feedback
---
 Ryujinx.Memory/MemoryBlock.cs | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

(limited to 'Ryujinx.Memory/MemoryBlock.cs')

diff --git a/Ryujinx.Memory/MemoryBlock.cs b/Ryujinx.Memory/MemoryBlock.cs
index c6b85b58..b68a1000 100644
--- a/Ryujinx.Memory/MemoryBlock.cs
+++ b/Ryujinx.Memory/MemoryBlock.cs
@@ -19,6 +19,8 @@ namespace Ryujinx.Memory
         private ConcurrentDictionary<MemoryBlock, byte> _viewStorages;
         private int _viewCount;
 
+        internal bool ForceWindows4KBView => _forceWindows4KBView;
+
         /// <summary>
         /// Pointer to the memory block data.
         /// </summary>
@@ -145,7 +147,7 @@ namespace Ryujinx.Memory
                 srcBlock.IncrementViewCount();
             }
 
-            MemoryManagement.MapView(srcBlock._sharedMemory, srcOffset, GetPointerInternal(dstOffset, size), size, _forceWindows4KBView);
+            MemoryManagement.MapView(srcBlock._sharedMemory, srcOffset, GetPointerInternal(dstOffset, size), size, this);
         }
 
         /// <summary>
@@ -156,7 +158,7 @@ namespace Ryujinx.Memory
         /// <param name="size">Size of the range to be unmapped</param>
         public void UnmapView(MemoryBlock srcBlock, ulong offset, ulong size)
         {
-            MemoryManagement.UnmapView(srcBlock._sharedMemory, GetPointerInternal(offset, size), size, _forceWindows4KBView);
+            MemoryManagement.UnmapView(srcBlock._sharedMemory, GetPointerInternal(offset, size), size, this);
         }
 
         /// <summary>
-- 
cgit v1.2.3-70-g09d2