julia
c11245dc - CLI: Use `GetModuleHandleExW` to locate libjulia.dll (#54617)

Commit
1 year ago
CLI: Use `GetModuleHandleExW` to locate libjulia.dll (#54617) This should be a more reliable look-up, since this will directly report the path of the currently-executing libjulia.dll. Without this PR, `LoadLibraryW` depends on the system library search order. When the top-level executable is adjacent to `libjulia.dll` (as it is for our binary distribution usually), then that search should be OK. However, applications that use Julia as a library can end up searching the system PATH before making it to the correct `lib/julia` directory, causing us to load the wrong version of `libjulia.dll`. In many cases, that extra load is benign due to the stricter separation of libraries/symbols on Windows - However, in general it's likely to be the cause of subtle bugs.
Author
Parents
Loading