From 3f7e12e949e22c762cdd2d44e8c60fc5a319beaf Mon Sep 17 00:00:00 2001 From: Christopher Deckers Date: Thu, 27 Jul 2023 14:35:56 +0200 Subject: [PATCH] Fixed memory leak in smooth scrolling due to incorrect visibility check. --- .../src/main/java/com/formdev/flatlaf/ui/FlatViewportUI.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatViewportUI.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatViewportUI.java index ed15723c2..7514f9d49 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatViewportUI.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatViewportUI.java @@ -82,7 +82,7 @@ public void ancestorAdded( AncestorEvent event ) { @Override public void ancestorMoved( AncestorEvent event ) { JViewport viewport = (JViewport)event.getComponent(); - if(viewport.isDisplayable()) { + if(viewport.isShowing()) { SmoothScrollingHelper.registerViewport( viewport ); } else { SmoothScrollingHelper.unregisterViewport( viewport );