Closed WeilongWen closed 1 week ago
Yeah, Some of fmu have dependent dlls. I have to add directory of the dll to the path. After the dll is loaded, entry dll is loaded successfully and already in use. RemoveDllDirectory can be release.
But what if the dependent dlls are loaded dynamically in the first dll? I assume that would cause issues? I suppose a more eloborate solution would be to keep the searchpath as long as the FMU is used.
With that said, I do suppose this resolves one class of issues.
Possible solution to #125
You are right. I'm ignoring that dlls that are being dependent on May also be loaded dynamically. We can keep the search path until the fmu is released.
I'm merging this as is, as it solves an issue. Keeping the path for a longer duration can be a possible future enhancement.
In the near future, I will do this.
Just to make sure I got this right:
On Windows, this PR adds the directory of the dll to be loaded to PATH (or akin to it), so that dependent DLLs can be loaded? Sounds reasonable. How about
RemoveDllDirectory
, does the directory not need to be searchable for the duration of the dll usage?