1
0
mirror of https://github.com/alliedmodders/metamod-source.git synced 2025-02-20 13:54:14 +01:00

fixed a crash bug where plugins that unload other plugins would cause the unload iterator to become corrupt

--HG--
extra : convert_revision : svn%3Ac2935e3e-5518-0410-8daf-afa5dab7d4e3/trunk%40410
This commit is contained in:
David Anderson 2007-06-26 17:57:18 +00:00
parent 3a6f1df52d
commit f4384399b0

View File

@ -496,23 +496,15 @@ bool CPluginManager::UnloadAll()
{
PluginIter i;
SourceHook::List<SourceMM::CPluginManager::CPlugin *> remqueue;
for (i=m_Plugins.begin(); i!=m_Plugins.end(); i++)
remqueue.push_back( (*i) );
char error[128];
bool status = true;
for (i=remqueue.begin(); i!=remqueue.end(); i++)
while ((i = m_Plugins.begin()) != m_Plugins.end())
{
if ( !_Unload( (*i), true, error, sizeof(error)) )
status = false;
}
m_Plugins.clear();
remqueue.clear();
return status;
}