parent
bef1321f00
commit
83a4c61048
2 changed files with 6 additions and 1 deletions
|
|
@ -196,6 +196,11 @@ void CPluginSystem::unloadAllPlugins() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void CPluginSystem::updateConfigPlugins(const std::vector<std::string>& plugins, bool& changed) {
|
void CPluginSystem::updateConfigPlugins(const std::vector<std::string>& plugins, bool& changed) {
|
||||||
|
if (m_lastConfigPlugins == plugins)
|
||||||
|
return;
|
||||||
|
|
||||||
|
m_lastConfigPlugins = plugins;
|
||||||
|
|
||||||
// unload all plugins that are no longer present
|
// unload all plugins that are no longer present
|
||||||
for (auto const& p : m_loadedPlugins | std::views::reverse) {
|
for (auto const& p : m_loadedPlugins | std::views::reverse) {
|
||||||
if (!p->m_loadedWithConfig || std::ranges::find(plugins, p->m_path) != plugins.end())
|
if (!p->m_loadedWithConfig || std::ranges::find(plugins, p->m_path) != plugins.end())
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,7 @@ class CPluginSystem {
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::vector<UP<CPlugin>> m_loadedPlugins;
|
std::vector<UP<CPlugin>> m_loadedPlugins;
|
||||||
|
std::vector<std::string> m_lastConfigPlugins;
|
||||||
jmp_buf m_pluginFaultJumpBuf;
|
jmp_buf m_pluginFaultJumpBuf;
|
||||||
|
|
||||||
std::expected<CPlugin*, std::string> loadPluginInternal(const std::string& path);
|
std::expected<CPlugin*, std::string> loadPluginInternal(const std::string& path);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue