Implement new static Unload(handle) instead of old Unload()

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@22580 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
David Elliott
2003-08-04 15:46:51 +00:00
parent 13f72d6b34
commit ff793cab3a

View File

@@ -300,25 +300,21 @@ bool wxDynamicLibrary::Load(wxString libname, int flags)
return IsLoaded(); return IsLoaded();
} }
void wxDynamicLibrary::Unload() /* static */ void wxDynamicLibrary::Unload(wxDllType handle)
{ {
if( IsLoaded() )
{
#if defined(__WXPM__) || defined(__EMX__) #if defined(__WXPM__) || defined(__EMX__)
DosFreeModule( m_handle ); DosFreeModule( handle );
#elif defined(HAVE_DLOPEN) || defined(__DARWIN__) #elif defined(HAVE_DLOPEN) || defined(__DARWIN__)
dlclose( m_handle ); dlclose( handle );
#elif defined(HAVE_SHL_LOAD) #elif defined(HAVE_SHL_LOAD)
shl_unload( m_handle ); shl_unload( handle );
#elif defined(__WINDOWS__) #elif defined(__WINDOWS__)
::FreeLibrary( m_handle ); ::FreeLibrary( handle );
#elif defined(__WXMAC__) && !defined(__DARWIN__) #elif defined(__WXMAC__) && !defined(__DARWIN__)
CloseConnection( (CFragConnectionID*) &m_handle ); CloseConnection( (CFragConnectionID*) &handle );
#else #else
#error "runtime shared lib support not implemented" #error "runtime shared lib support not implemented"
#endif #endif
m_handle = 0;
}
} }
void *wxDynamicLibrary::GetSymbol(const wxString &name, bool *success) const void *wxDynamicLibrary::GetSymbol(const wxString &name, bool *success) const