From b3f8f075a2d1585a6fe19b48c389d7adb21c7ded Mon Sep 17 00:00:00 2001 From: Max Charlamb <44248479+max-charlamb@users.noreply.github.com> Date: Fri, 3 Oct 2025 11:40:57 -0400 Subject: [PATCH 1/2] don't free dlls in managed SOS host --- src/SOS/SOS.Hosting/RuntimeWrapper.cs | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/src/SOS/SOS.Hosting/RuntimeWrapper.cs b/src/SOS/SOS.Hosting/RuntimeWrapper.cs index bfca28db91..633dddacaf 100644 --- a/src/SOS/SOS.Hosting/RuntimeWrapper.cs +++ b/src/SOS/SOS.Hosting/RuntimeWrapper.cs @@ -156,21 +156,6 @@ protected override void Destroy() ComWrapper.ReleaseWithCheck(_cdacDataProcess); _cdacDataProcess = IntPtr.Zero; } - if (_dacHandle != IntPtr.Zero) - { - DataTarget.PlatformFunctions.FreeLibrary(_dacHandle); - _dacHandle = IntPtr.Zero; - } - if (_cdacHandle != IntPtr.Zero) - { - DataTarget.PlatformFunctions.FreeLibrary(_cdacHandle); - _cdacHandle = IntPtr.Zero; - } - if (_dbiHandle != IntPtr.Zero) - { - DataTarget.PlatformFunctions.FreeLibrary(_dbiHandle); - _dbiHandle = IntPtr.Zero; - } } #region IRuntime (native) From a6c68887510cdd9a2b2facc6acc4b083942df3be Mon Sep 17 00:00:00 2001 From: Max Charlamb <44248479+max-charlamb@users.noreply.github.com> Date: Fri, 3 Oct 2025 15:13:18 -0400 Subject: [PATCH 2/2] keep unloading the dbi --- src/SOS/SOS.Hosting/RuntimeWrapper.cs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/SOS/SOS.Hosting/RuntimeWrapper.cs b/src/SOS/SOS.Hosting/RuntimeWrapper.cs index 633dddacaf..56535b722c 100644 --- a/src/SOS/SOS.Hosting/RuntimeWrapper.cs +++ b/src/SOS/SOS.Hosting/RuntimeWrapper.cs @@ -156,6 +156,19 @@ protected override void Destroy() ComWrapper.ReleaseWithCheck(_cdacDataProcess); _cdacDataProcess = IntPtr.Zero; } + if (_dacHandle != IntPtr.Zero) + { + _dacHandle = IntPtr.Zero; + } + if (_cdacHandle != IntPtr.Zero) + { + _cdacHandle = IntPtr.Zero; + } + if (_dbiHandle != IntPtr.Zero) + { + DataTarget.PlatformFunctions.FreeLibrary(_dbiHandle); + _dbiHandle = IntPtr.Zero; + } } #region IRuntime (native)