When calling HidExit(), function ReleaseHidApi() is also called.
This function clears the variable that holds the default library name:
HidApiLoadedLibrary := ''; // Line 308 in hidapi.inc
When in the same program the HID API functions are used again, i.e. the library is reloaded, this will fail because the library name is now gone.
Global variable HidApiLoadedLibrary is not re-initialized.
This should be replaced with setting the library to the global default value:
HidApiLoadedLibrary := LIBHIDAPI; // Line 308 in hidapi.inc
When calling HidExit(), function ReleaseHidApi() is also called.
This function clears the variable that holds the default library name:
HidApiLoadedLibrary := ''; // Line 308 in hidapi.incWhen in the same program the HID API functions are used again, i.e. the library is reloaded, this will fail because the library name is now gone.
Global variable HidApiLoadedLibrary is not re-initialized.
This should be replaced with setting the library to the global default value:
HidApiLoadedLibrary := LIBHIDAPI; // Line 308 in hidapi.inc