Add wxDynamicLibrary::Attach()

This is symmetric with Detach() and can be useful and doesn't cost
anything to have.
This commit is contained in:
Vadim Zeitlin
2021-01-25 00:10:10 +01:00
parent e094734a89
commit 4de8857c85
2 changed files with 20 additions and 3 deletions

View File

@@ -242,6 +242,9 @@ public:
// library couldn't be loaded but simply returns NULL
static wxDllType RawLoad(const wxString& libname, int flags = wxDL_DEFAULT);
// attach to an existing handle
void Attach(wxDllType h) { Unload(); m_handle = h; }
// detach the library object from its handle, i.e. prevent the object from
// unloading the library in its dtor -- the caller is now responsible for
// doing this