MCPcopy Create free account
hub / github.com/IChooseYou/Reclass / UnloadPlugin

Method UnloadPlugin

src/pluginmanager.cpp:144–178  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

142}
143
144bool PluginManager::UnloadPlugin(const QString& name)
145{
146 for (int i = 0; i < m_entries.size(); ++i)
147 {
148 if (QString::fromStdString(m_entries[i].plugin->Name()) == name)
149 {
150 qDebug() << "PluginManager: Unloading plugin:" << name;
151
152 IPlugin* plugin = m_entries[i].plugin;
153
154 // Unregister provider from global registry
155 if (plugin->Type() == IPlugin::ProviderPlugin)
156 {
157 QString identifier = name.toLower().replace(" ", "");
158 ProviderRegistry::instance().unregisterProvider(identifier);
159 }
160
161 // Delete plugin instance
162 delete plugin;
163
164 // Unload library
165 m_entries[i].library->unload();
166 delete m_entries[i].library;
167
168 // Remove from lists
169 m_entries.remove(i);
170 m_plugins.remove(i);
171
172 return true;
173 }
174 }
175
176 qWarning() << "PluginManager: Plugin not found:" << name;
177 return false;
178}
179
180void PluginManager::UnloadPlugins()
181{

Callers 1

showPluginsDialogMethod · 0.80

Calls 4

TypeMethod · 0.80
unregisterProviderMethod · 0.80
sizeMethod · 0.45
NameMethod · 0.45

Tested by

no test coverage detected