mirror of
https://github.com/4sval/FModel.git
synced 2026-03-25 19:25:01 -05:00
thread lock
This commit is contained in:
parent
41ebad422d
commit
eebaa19178
|
|
@ -1 +1 @@
|
|||
Subproject commit 7d4cd4656e2ebf97caea2d010e20b033612e88ca
|
||||
Subproject commit bfb2b3ce34ceee5c9785d845a5da2b594f534493
|
||||
|
|
@ -908,6 +908,7 @@ public class CUE4ParseViewModel : ViewModel
|
|||
}
|
||||
}
|
||||
|
||||
private readonly object _rawData = new ();
|
||||
public void ExportData(string fullPath, bool updateUi = true)
|
||||
{
|
||||
var fileName = fullPath.SubstringAfterLast('/');
|
||||
|
|
@ -916,9 +917,12 @@ public class CUE4ParseViewModel : ViewModel
|
|||
string path = UserSettings.Default.RawDataDirectory;
|
||||
Parallel.ForEach(assets, kvp =>
|
||||
{
|
||||
path = Path.Combine(path, UserSettings.Default.KeepDirectoryStructure ? kvp.Key : kvp.Key.SubstringAfterLast('/')).Replace('\\', '/');
|
||||
Directory.CreateDirectory(path.SubstringBeforeLast('/'));
|
||||
File.WriteAllBytes(path, kvp.Value);
|
||||
lock (_rawData)
|
||||
{
|
||||
path = Path.Combine(UserSettings.Default.RawDataDirectory, UserSettings.Default.KeepDirectoryStructure ? kvp.Key : kvp.Key.SubstringAfterLast('/')).Replace('\\', '/');
|
||||
Directory.CreateDirectory(path.SubstringBeforeLast('/'));
|
||||
File.WriteAllBytes(path, kvp.Value);
|
||||
}
|
||||
});
|
||||
|
||||
if (updateUi)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user