Skip to content

Commit

Permalink
Merge pull request #96 from LaegotKit/jTesting
Browse files Browse the repository at this point in the history
Added removelist check
  • Loading branch information
mj-colonel-panic authored May 3, 2022
2 parents e6848a2 + f0f51bd commit 3f50672
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions Forms/FormMain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2747,18 +2747,21 @@ private void RemoveExitedScripts()
finally
{
m_oScriptList.ReleaseReaderLock();
if (m_oScriptList.AcquireWriterLock())
if (removeList.Count > 0)
{
try
if (m_oScriptList.AcquireWriterLock())
{
for (var i = removeList.Count - 1; i > -1; i--)
try
{
m_oScriptList.RemoveAt(removeList[i]);
for (var i = removeList.Count - 1; i > -1; i--)
{
m_oScriptList.RemoveAt(removeList[i]);
}
}
finally
{
m_oScriptList.ReleaseWriterLock();
}
}
finally
{
m_oScriptList.ReleaseWriterLock();
}
}
}
Expand Down

0 comments on commit 3f50672

Please sign in to comment.