From 1f35c1b60073ab33b28fe4a916819e078842e67c Mon Sep 17 00:00:00 2001 From: greateggsgreg <36009512+greateggsgreg@users.noreply.github.com> Date: Sat, 29 Nov 2025 17:25:58 -0500 Subject: [PATCH] hostfxr.py - Sanity check on shutdown that both _handle and _dll are still present --- clr_loader/hostfxr.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clr_loader/hostfxr.py b/clr_loader/hostfxr.py index e32423c..3932082 100644 --- a/clr_loader/hostfxr.py +++ b/clr_loader/hostfxr.py @@ -127,7 +127,7 @@ def _get_callable(self, assembly_path: StrOrPath, typename: str, function: str): return ffi.cast("component_entry_point_fn", delegate_ptr[0]) def shutdown(self) -> None: - if self._handle is not None: + if self._handle and self._dll: self._dll.hostfxr_close(self._handle) self._handle = None