changeset 11205:b1f419c89b0a

8217492: JavaFX - memory leak after the event WindowEvent.DESTROY Summary: WindowStage, cleanup platformWindows on setPlatformWindowClosed Reviewed-by: kcr Contributed-by: fk@sandec.de
author kcr
date Wed, 27 Feb 2019 10:18:05 -0800
parents 5ee37427d89a
children 971d58a20171
files modules/javafx.graphics/src/main/java/com/sun/javafx/tk/quantum/WindowStage.java
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/modules/javafx.graphics/src/main/java/com/sun/javafx/tk/quantum/WindowStage.java	Mon Feb 25 08:22:45 2019 -0800
+++ b/modules/javafx.graphics/src/main/java/com/sun/javafx/tk/quantum/WindowStage.java	Wed Feb 27 10:18:05 2019 -0800
@@ -832,7 +832,10 @@
     // closed notification. This state is necessary to prevent the platform
     // window from being closed more than once.
     void setPlatformWindowClosed() {
-        platformWindow = null;
+        if (platformWindow != null) {
+            platformWindows.remove(platformWindow);
+            platformWindow = null;
+        }
     }
 
     static void addActiveWindow(WindowStage window) {