diff --git a/core/src/main/java/com/seibel/distanthorizons/core/file/fullDatafile/V2/FullDataSourceProviderV2.java b/core/src/main/java/com/seibel/distanthorizons/core/file/fullDatafile/V2/FullDataSourceProviderV2.java index 5c2207212..32dad829b 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/file/fullDatafile/V2/FullDataSourceProviderV2.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/file/fullDatafile/V2/FullDataSourceProviderV2.java @@ -134,14 +134,14 @@ public class FullDataSourceProviderV2 implements IDebugRenderable, AutoCloseable public void addDataSourceUpdateListener(IDataSourceUpdateListenerFunc listener) { - synchronized (this.dataUpdater) + synchronized (this.dataUpdater.dateSourceUpdateListeners) { this.dataUpdater.dateSourceUpdateListeners.add(listener); } } public void removeDataSourceUpdateListener(IDataSourceUpdateListenerFunc listener) { - synchronized (this.dataUpdater) + synchronized (this.dataUpdater.dateSourceUpdateListeners) { this.dataUpdater.dateSourceUpdateListeners.add(listener); } diff --git a/core/src/main/java/com/seibel/distanthorizons/core/file/fullDatafile/V2/FullDataUpdaterV2.java b/core/src/main/java/com/seibel/distanthorizons/core/file/fullDatafile/V2/FullDataUpdaterV2.java index e9d2d9790..d82f707bf 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/file/fullDatafile/V2/FullDataUpdaterV2.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/file/fullDatafile/V2/FullDataUpdaterV2.java @@ -150,11 +150,14 @@ public class FullDataUpdaterV2 implements IDebugRenderable, AutoCloseable } - for (IDataSourceUpdateListenerFunc listener : this.dateSourceUpdateListeners) + synchronized (this.dateSourceUpdateListeners) { - if (listener != null) + for (IDataSourceUpdateListenerFunc listener : this.dateSourceUpdateListeners) { - listener.OnDataSourceUpdated(recipientDataSource); + if (listener != null) + { + listener.OnDataSourceUpdated(recipientDataSource); + } } } }