File tree Expand file tree Collapse file tree 1 file changed +12
-8
lines changed
xivModdingFramework/Helpers Expand file tree Collapse file tree 1 file changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -799,17 +799,21 @@ public static byte[] GetImageSharpPixels(Image<Rgba32> img)
799
799
800
800
public static string GetUniqueSubfolder ( string basePath , string prefix = "" )
801
801
{
802
- var id = 0 ;
803
- var path = Path . GetFullPath ( Path . Combine ( basePath , prefix + id . ToString ( ) ) ) ;
804
- while ( Directory . Exists ( path ) )
802
+ lock ( _SubfolderLock )
805
803
{
806
- id ++ ;
807
- path = Path . GetFullPath ( Path . Combine ( basePath , prefix + id . ToString ( ) ) ) ;
804
+ var id = 0 ;
805
+ var path = Path . GetFullPath ( Path . Combine ( basePath , prefix + id . ToString ( ) ) ) ;
806
+ while ( Directory . Exists ( path ) )
807
+ {
808
+ id ++ ;
809
+ path = Path . GetFullPath ( Path . Combine ( basePath , prefix + id . ToString ( ) ) ) ;
810
+ }
811
+ Directory . CreateDirectory ( path ) ;
812
+ return path ;
808
813
}
809
- Directory . CreateDirectory ( path ) ;
810
-
811
- return path ;
812
814
}
815
+
816
+ public static object _SubfolderLock = new object ( ) ;
813
817
public static string GetFrameworkTempSubfolder ( string prefix = "" )
814
818
{
815
819
var basePath = GetFrameworkTempFolder ( ) ;
You can’t perform that action at this time.
0 commit comments