fix possible race condition

This commit is contained in:
stax76
2022-07-02 15:10:22 +02:00
parent fb294c441d
commit 40565e8b3d

View File

@@ -1276,12 +1276,17 @@ namespace mpvnet
}
}
static object LoadFolderLockObject = new object();
public void LoadFolder()
{
if (!App.AutoLoadFolder || Control.ModifierKeys.HasFlag(Keys.Shift))
return;
Thread.Sleep(1000);
lock (LoadFolderLockObject)
{
string path = GetPropertyString("path");
if (!File.Exists(path) || GetPropertyInt("playlist-count") != 1)
@@ -1312,6 +1317,7 @@ namespace mpvnet
if (index > 0)
CommandV("playlist-move", "0", (index + 1).ToString());
}
}
bool WasAviSynthLoaded;