From 8a1c541b7e55c80b444e1c7ff41bcaa4ec16fa9e Mon Sep 17 00:00:00 2001 From: Brian Date: Sun, 22 Dec 2013 19:53:03 -0700 Subject: [PATCH] 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. --- code/src/FileGroupTab.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/code/src/FileGroupTab.cs b/code/src/FileGroupTab.cs index e6e1275..3645681 100644 --- a/code/src/FileGroupTab.cs +++ b/code/src/FileGroupTab.cs @@ -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);