fix possible race condition
This commit is contained in:
@@ -1276,12 +1276,17 @@ namespace mpvnet
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static object LoadFolderLockObject = new object();
|
||||||
|
|
||||||
public void LoadFolder()
|
public void LoadFolder()
|
||||||
{
|
{
|
||||||
if (!App.AutoLoadFolder || Control.ModifierKeys.HasFlag(Keys.Shift))
|
if (!App.AutoLoadFolder || Control.ModifierKeys.HasFlag(Keys.Shift))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Thread.Sleep(1000);
|
Thread.Sleep(1000);
|
||||||
|
|
||||||
|
lock (LoadFolderLockObject)
|
||||||
|
{
|
||||||
string path = GetPropertyString("path");
|
string path = GetPropertyString("path");
|
||||||
|
|
||||||
if (!File.Exists(path) || GetPropertyInt("playlist-count") != 1)
|
if (!File.Exists(path) || GetPropertyInt("playlist-count") != 1)
|
||||||
@@ -1312,6 +1317,7 @@ namespace mpvnet
|
|||||||
if (index > 0)
|
if (index > 0)
|
||||||
CommandV("playlist-move", "0", (index + 1).ToString());
|
CommandV("playlist-move", "0", (index + 1).ToString());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bool WasAviSynthLoaded;
|
bool WasAviSynthLoaded;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user