! * \brief Release the handle to the dynamic library * \details Calls platform specific code to release the handle to a dynamic library * \param[in,out] libHandle Platform handle to the dynamic library, NULL'd on output * * \returns If the function succeeds, return value is nonzero. If the function fails, return value is zero. * */
| 83 | * |
| 84 | */ |
| 85 | inline int FreeSharedLibrary(void*& libHandle) |
| 86 | { |
| 87 | int result = 0; |
| 88 | |
| 89 | #if defined( _WIN32 ) |
| 90 | if (libHandle != 0) |
| 91 | result = ::FreeLibrary(reinterpret_cast<HMODULE>(libHandle)); |
| 92 | #else |
| 93 | if( libHandle != 0 ) |
| 94 | result = ( ::dlclose( libHandle ) == 0 ); |
| 95 | #endif |
| 96 | |
| 97 | libHandle = NULL; |
| 98 | |
| 99 | return result; |
| 100 | } |
| 101 | |
| 102 | /*! |
| 103 | * \brief Query for function pointer in library |