Fixed exception when files were updated while script was running.

m_UpdatedFiles was being updated while it was still being used by the
script thread.  Instead, copy the list, clear it out, and have the
script thread process the copy.
This commit is contained in:
Brian 2013-12-22 19:53:03 -07:00
parent e9ac96f2bc
commit 8a1c541b7e
1 changed files with 3 additions and 2 deletions

View File

@ -571,10 +571,11 @@ namespace FileWatcher
try
{
updated(m_UpdatedFiles);
var updateFiles = m_UpdatedFiles;
m_UpdatedFiles.Clear();
updated(updateFiles);
Logger.Log("Just finished running '" + ScriptPath + "'");
Form1.Instance.notifyIcon1.ShowBalloonTip(500, "Script Ran", "Finished running '" + ScriptPath + "'", ToolTipIcon.Info);