nagisa / rust_libloading

Bindings around the platform's dynamic library loading primitives with greatly improved memory safety.
https://docs.rs/libloading
ISC License
1.22k stars 100 forks source link

Library is cached if loaded multiple times #135

Closed TobiasGrothmann closed 8 months ago

TobiasGrothmann commented 8 months ago

Hi there,

I have a little bit of a special use-case and I don't know very much about loading dynamic libraries at runtime.

I am trying to:

Now comes the part that doesn't work:

The problem is, that I still somehow get the old function and get the old return value from it. How can I force it to unload and reload the library?


Working on MacOS libloading = "0.8.1"

nagisa commented 8 months ago

This is a platform behaviour libloading can do nothing about. Please refer to the list of closed issues, for example https://github.com/nagisa/rust_libloading/issues/59.