| 79 | } |
| 80 | |
| 81 | void PluginManager::unloadPlugin(std::string_view _file) |
| 82 | { |
| 83 | MYGUI_ASSERT(mIsInitialise, getClassTypeName() << " used but not initialised"); |
| 84 | |
| 85 | DynLibList::iterator it = mLibs.find(_file); |
| 86 | if (it != mLibs.end()) |
| 87 | { |
| 88 | // Call plugin shutdown |
| 89 | DLL_STOP_PLUGIN pFunc = reinterpret_cast<DLL_STOP_PLUGIN>((*it).second->getSymbol("dllStopPlugin")); |
| 90 | |
| 91 | MYGUI_ASSERT( |
| 92 | nullptr != pFunc, |
| 93 | getClassTypeName() << "Cannot find symbol 'dllStopPlugin' in library " << _file); |
| 94 | |
| 95 | // this must call uninstallPlugin |
| 96 | pFunc(); |
| 97 | // Unload library (destroyed by DynLibManager) |
| 98 | DynLibManager::getInstance().unload((*it).second); |
| 99 | mLibs.erase(it); |
| 100 | } |
| 101 | } |
| 102 | |
| 103 | void PluginManager::_load(xml::ElementPtr _node, std::string_view /*_file*/, Version _version) |
| 104 | { |