File tree Expand file tree Collapse file tree 1 file changed +3
-0
lines changed Expand file tree Collapse file tree 1 file changed +3
-0
lines changed Original file line number Diff line number Diff line change 22using System . Linq ;
33using System . Reflection ;
44using System . Runtime . Serialization ;
5+ using System . Threading ;
56using CSync . Extensions ;
67using HarmonyLib ;
78using JetBrains . Annotations ;
@@ -16,6 +17,7 @@ namespace CSync.Lib;
1617public class SyncedConfig < T > : SyncedInstance < T > , ISyncedConfig where T : SyncedConfig < T >
1718{
1819 public ISyncedEntryContainer EntryContainer { get ; } = new SyncedEntryContainer ( ) ;
20+ private int _entryContainerPopulated = 0 ;
1921
2022 public SyncedConfig ( string guid )
2123 {
@@ -36,6 +38,7 @@ public SyncedConfig(string guid)
3638
3739 internal void PopulateEntryContainer ( )
3840 {
41+ if ( Interlocked . Exchange ( ref _entryContainerPopulated , 1 ) != 0 ) return ;
3942 foreach ( var fieldInfo in SyncedEntryFields . Value )
4043 {
4144 var entryBase = ( SyncedEntryBase ) fieldInfo . GetValue ( this ) ;
You can’t perform that action at this time.
0 commit comments