AutoExecConfig() protects against double-call bugs now (amb 1356)
--HG-- extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%401852
This commit is contained in:
parent
a446121d6e
commit
a9017a8291
@ -799,6 +799,17 @@ AutoConfig *CPlugin::GetConfig(unsigned int i)
|
|||||||
|
|
||||||
void CPlugin::AddConfig(bool autoCreate, const char *cfg, const char *folder)
|
void CPlugin::AddConfig(bool autoCreate, const char *cfg, const char *folder)
|
||||||
{
|
{
|
||||||
|
/* Do a check for duplicates to prevent double-execution */
|
||||||
|
for (size_t i = 0; i < m_configs.size(); i++)
|
||||||
|
{
|
||||||
|
if (m_configs[i]->autocfg.compare(cfg) == 0
|
||||||
|
&& m_configs[i]->folder.compare(folder) == 0
|
||||||
|
&& m_configs[i]->create == autoCreate)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
AutoConfig *c = new AutoConfig;
|
AutoConfig *c = new AutoConfig;
|
||||||
|
|
||||||
c->autocfg = cfg;
|
c->autocfg = cfg;
|
||||||
|
Loading…
Reference in New Issue
Block a user