Skip to content

Commit

Permalink
Fix #2
Browse files Browse the repository at this point in the history
  • Loading branch information
Conticop committed Feb 18, 2020
1 parent a81a844 commit b3c3a8d
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions scripts/dotnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,20 @@ def apply_script(protocol, connection, config):
assert err_code == 0, "Failed to create OnLoad delegate (code={})".format(err_code)

def exit_handler():
func_ptr = c_void_p()
err_code = _CLRLIB.coreclr_create_delegate(
_CLR_handle.value,
_CLR_domain.value,
"_boot, Version=1.0.0.0".encode("utf8"),
"_Internal.Bootstrapper".encode("utf8"),
"OnUnload".encode("utf8"),
byref(func_ptr)
)
if err_code == 0:
try:
CFUNCTYPE(None)(func_ptr.value)()
except:
pass
_CLRLIB.coreclr_shutdown.restype = c_int
_CLRLIB.coreclr_shutdown.argtypes = [
c_void_p,
Expand Down

0 comments on commit b3c3a8d

Please sign in to comment.