diff --git a/include/wx/dynlib.h b/include/wx/dynlib.h index 860088f690..eb402a3dd9 100644 --- a/include/wx/dynlib.h +++ b/include/wx/dynlib.h @@ -76,6 +76,8 @@ class wxDllLoader @return A handle to the loaded DLL. Use success parameter to test if it is valid. */ static wxDllType LoadLibrary(const wxString & libname, bool *success); + /** This function unloads the shared library. */ + static void UnloadLibrary(wxDllType dll); /** This function returns a valid handle for the main program itself. */ static wxDllType GetProgramHandle(void); diff --git a/src/common/dynlib.cpp b/src/common/dynlib.cpp index 0a161789d8..a72fd4dac1 100644 --- a/src/common/dynlib.cpp +++ b/src/common/dynlib.cpp @@ -221,6 +221,14 @@ wxDllLoader::LoadLibrary(const wxString & lib_name, bool *success) return handle; } + +/* static */ +void +wxDllLoader::UnloadLibrary(wxDllType handle) +{ + wxDllClose(handle); +} + /* static */ void * wxDllLoader::GetSymbol(wxDllType dllHandle, const wxString &name)