On Tue, 30 May 2023 15:43:57 GMT, Alexey Ivanov <aiva...@openjdk.org> wrote:
>> Rajat Mahajan has updated the pull request incrementally with one additional >> commit since the last revision: >> >> changes as siggested in review > > src/java.desktop/windows/classes/sun/awt/windows/ThemeReader.java line 131: > >> 129: } >> 130: dpiAwareWidgetToTheme.get(dpi).clear(); >> 131: dpiAwareWidgetToTheme.clear(); > > Suggestion: > > for (Map<String, Long> dpiVal : > dpiAwareWidgetToTheme.values()) { > for (Long value : dpiVal.values()) { > closeTheme(value); > } > dpiVal.clear(); > } > dpiAwareWidgetToTheme.clear(); > > Avoid additional call to `get`. This is even more serious: all the theme handles are closed but the maps for DPIs other than the passed `dpi` aren't cleared. With `clear` inside the loop, maps for all DPIs are cleared. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/13701#discussion_r1210504722