Skip to content

Commit e74a8fe

Browse files
committed
Ensure that the dotnet_root string lives long enough
1 parent 301500a commit e74a8fe

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

clr_loader/hostfxr.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,8 @@ def _get_handle(dll, dotnet_root, runtime_config):
106106
params.size = ffi.sizeof("hostfxr_initialize_parameters")
107107
# params.host_path = ffi.new("char_t[]", encode(sys.executable))
108108
params.host_path = ffi.NULL
109-
params.dotnet_root = ffi.new("char_t[]", encode(dotnet_root))
109+
dotnet_root_p = ffi.new("char_t[]", encode(dotnet_root))
110+
params.dotnet_root = dotnet_root_p
110111

111112
handle_ptr = ffi.new("hostfxr_handle*")
112113

0 commit comments

Comments
 (0)