pluginapi: unregister callbacks on lost ptrs

This commit is contained in:
Vaxry 2024-04-22 15:50:01 +01:00
parent 450343b7b8
commit e91513a5e8
4 changed files with 21 additions and 17 deletions

View file

@ -121,7 +121,7 @@ void CPluginSystem::unloadPlugin(const CPlugin* plugin, bool eject) {
// save these two for dlclose and a log,
// as erase_if will kill the pointer
const auto PLNAME = plugin->name;
const auto PLNAME = plugin->name;
const auto PLHANDLE = plugin->m_pHandle;
std::erase_if(m_vLoadedPlugins, [&](const auto& other) { return other->m_pHandle == PLHANDLE; });