The pin_dll! macro, which allows library users to specify that, on Windows builds, the dll handle auxtools takes should not be pinned. The documentation specifies that there are very few use cases for not pinning the dll, and that caution should be taken when deciding not to pin the dll.
The auxtools_full_shutdown FFI function and corresponding full_shutdown attribute. Calling auxtools_full_shutdown will, in addition to the standard shutdown sequence, uninstall the proc and runtime hooks, then call every function with the full_shutdown attribute. Additionally, on Windows, if the pin_dll! macro was used to specify the dll shouldn't be pinned, FreeLibrary will be called, unloading the dll once all other handles, including the one created by BYOND itself, are released.
Redundant calls to auxtools_shutdown and auxtools_full_shutdown will fail instead of crashing.
This PR adds the following:
pin_dll!
macro, which allows library users to specify that, on Windows builds, the dll handle auxtools takes should not be pinned. The documentation specifies that there are very few use cases for not pinning the dll, and that caution should be taken when deciding not to pin the dll.auxtools_full_shutdown
FFI function and correspondingfull_shutdown
attribute. Callingauxtools_full_shutdown
will, in addition to the standard shutdown sequence, uninstall the proc and runtime hooks, then call every function with thefull_shutdown
attribute. Additionally, on Windows, if thepin_dll!
macro was used to specify the dll shouldn't be pinned,FreeLibrary
will be called, unloading the dll once all other handles, including the one created by BYOND itself, are released.auxtools_shutdown
andauxtools_full_shutdown
will fail instead of crashing.