From 4f1e5cdb05ba1c1c4e707b89dd77bcaa0133c18d Mon Sep 17 00:00:00 2001 From: Karl Tauber Date: Wed, 3 Dec 2025 19:13:07 +0100 Subject: [PATCH] IntelliJ Themes: do not release JSON memory to allow re-using theme instance (issue #1020) --- CHANGELOG.md | 2 ++ .../main/java/com/formdev/flatlaf/IntelliJTheme.java | 11 +++-------- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e9655a95..d2543715 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -32,6 +32,8 @@ FlatLaf Change Log modal dialogs. (issue #1048) - JideButton, JideToggleButton, JideSplitButton and JideToggleSplitButton: Paint border in button style `TOOLBAR_STYLE` if in selected state. (issue #1045) +- IntelliJ Themes: Fixed problem when using theme instance more than once when + switching to that theme. (issue #990) ## 3.6.2 diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/IntelliJTheme.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/IntelliJTheme.java index 21874425..27370300 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/IntelliJTheme.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/IntelliJTheme.java @@ -58,9 +58,9 @@ public class IntelliJTheme public final boolean dark; public final String author; - private Map jsonColors; - private Map jsonUI; - private Map jsonIcons; + private final Map jsonColors; + private final Map jsonUI; + private final Map jsonIcons; private Map namedColors = Collections.emptyMap(); @@ -276,11 +276,6 @@ public class IntelliJTheme put( properties, key, value ); } - - // let Java release memory - jsonColors = null; - jsonUI = null; - jsonIcons = null; } private String get( Properties properties, Map themeSpecificProps, String key ) {