Skip to content

Commit

Permalink
Lock configuration when deleting copies.
Browse files Browse the repository at this point in the history
  • Loading branch information
enzo1982 committed Nov 28, 2018
1 parent 5f7e73e commit cf0ea61
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions runtime/common/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,17 +98,20 @@ Void BoCA::Config::Free(Config *config)
{
if (config != NIL)
{
for (Int i = 0; i < copies.Length(); i++)
copies.LockForWrite();

foreach (Config *copy, copies)
{
if (copies.GetNth(i) == config)
{
copies.RemoveNth(i);
if (copy != config) continue;

copies.RemoveNth(foreachindex);

delete config;
delete config;

break;
}
break;
}

copies.Unlock();
}
else if (instance != NIL)
{
Expand Down

0 comments on commit cf0ea61

Please sign in to comment.