From 9eb1dd0ec071e1a20fd6ecefdb3b6a17182be67a Mon Sep 17 00:00:00 2001 From: isanae <14251494+isanae@users.noreply.github.com> Date: Sat, 20 Feb 2021 05:03:17 -0500 Subject: clearPlugins() must be called to load the blacklist or it will be empty when loadPlugins() runs --- src/plugincontainer.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/plugincontainer.cpp') diff --git a/src/plugincontainer.cpp b/src/plugincontainer.cpp index c703a36a..0ebe924d 100644 --- a/src/plugincontainer.cpp +++ b/src/plugincontainer.cpp @@ -952,6 +952,12 @@ void PluginContainer::reloadPlugin(QString const& filepath) void PluginContainer::unloadPlugins() { + if (m_Organizer) { + // clearPlugins() must be called before loadPlugins() since it actually + // loads the blacklist + m_Organizer->settings().plugins().clearPlugins(); + } + bf::for_each(m_Plugins, [](auto& t) { t.second.clear(); }); bf::for_each(m_AccessPlugins, [](auto& t) { t.second.clear(); }); m_Requirements.clear(); -- cgit v1.3.1 From 2bd755743cd83ab06db66a254f7295d3fbeb776f Mon Sep 17 00:00:00 2001 From: isanae <14251494+isanae@users.noreply.github.com> Date: Sat, 20 Feb 2021 12:49:08 -0500 Subject: clarified comment --- src/plugincontainer.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/plugincontainer.cpp') diff --git a/src/plugincontainer.cpp b/src/plugincontainer.cpp index 0ebe924d..93a66ece 100644 --- a/src/plugincontainer.cpp +++ b/src/plugincontainer.cpp @@ -953,8 +953,12 @@ void PluginContainer::reloadPlugin(QString const& filepath) void PluginContainer::unloadPlugins() { if (m_Organizer) { - // clearPlugins() must be called before loadPlugins() since it actually - // loads the blacklist + // this will clear several structures that can hold on to pointers to + // plugins, as well as read the plugin blacklist from the ini file, which + // is used in loadPlugins() below to skip plugins + // + // note that the first thing loadPlugins() does is call unloadPlugins(), + // so this makes sure the blacklist is always available m_Organizer->settings().plugins().clearPlugins(); } -- cgit v1.3.1