From 14c6ee4d27b443d271b59d894ac6c06028aa45ff Mon Sep 17 00:00:00 2001 From: Mikaƫl Capelle Date: Thu, 28 Apr 2022 13:24:27 +0200 Subject: Ties plugin to the PluginContainer. --- src/plugincontainer.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/plugincontainer.cpp') diff --git a/src/plugincontainer.cpp b/src/plugincontainer.cpp index c4640cc3..61169196 100644 --- a/src/plugincontainer.cpp +++ b/src/plugincontainer.cpp @@ -467,8 +467,8 @@ IPlugin* PluginContainer::registerPlugin(QObject *plugin, const QString& filepat } } else { - log::warn("Trying to register two plugins with the name '{}', the second one will not be registered.", - pluginObj->name()); + log::warn("Trying to register two plugins with the name '{}' (from {} and {}), the second one will not be registered.", + pluginObj->name(), this->filepath(other), QDir::cleanPath(filepath)); return nullptr; } } @@ -481,6 +481,7 @@ IPlugin* PluginContainer::registerPlugin(QObject *plugin, const QString& filepat bf::at_key(m_Plugins).push_back(plugin); plugin->setProperty("filepath", QDir::cleanPath(filepath)); + plugin->setParent(this); if (m_Organizer) { m_Organizer->settings().plugins().registerPlugin(pluginObj); @@ -921,6 +922,8 @@ void PluginContainer::unloadPlugin(MOBase::IPlugin* plugin, QObject* object) } + object->deleteLater(); + // Do this at the end. m_Requirements.erase(plugin); } -- cgit v1.3.1