Example #1
0
void cPlugin::Unload(void)
{
	auto pm = cPluginManager::Get();
	pm->RemovePluginCommands(this);
	pm->RemovePluginConsoleCommands(this);
	pm->RemoveHooks(this);
	OnDisable();
	m_Status = cPluginManager::psUnloaded;
	m_LoadError.clear();
}
Example #2
0
void cPluginManager::RemovePlugin(cPlugin * a_Plugin)
{
	for (PluginMap::iterator itr = m_Plugins.begin(); itr != m_Plugins.end(); ++itr)
	{
		if (itr->second == a_Plugin)
		{
			m_Plugins.erase(itr);
			break;
		}
	}
	
	RemovePluginCommands(a_Plugin);
	RemovePluginConsoleCommands(a_Plugin);
	RemoveHooks(a_Plugin);
	if (a_Plugin != NULL)
	{
		a_Plugin->OnDisable();
	}
	delete a_Plugin;
}