diff --git a/theme/src/main/java/com/github/weisj/darklaf/theme/event/ThemeEventSupport.java b/theme/src/main/java/com/github/weisj/darklaf/theme/event/ThemeEventSupport.java index 13d50812..0a91fbb5 100644 --- a/theme/src/main/java/com/github/weisj/darklaf/theme/event/ThemeEventSupport.java +++ b/theme/src/main/java/com/github/weisj/darklaf/theme/event/ThemeEventSupport.java @@ -43,8 +43,10 @@ public class ThemeEventSupport consumer) { - listenerList.forEach(listener -> { - if (listener != null) consumer.accept(listener, event); - }); + synchronized (listenerList) { + new ArrayList<>(listenerList).forEach(listener -> { + if (listener != null) consumer.accept(listener, event); + }); + } } }