RFR: 8319779: SystemMenu: memory leak due to listener never being removed [v18]

Johan Vos jvos at openjdk.org
Sun Jul 14 14:01:57 UTC 2024


On Tue, 9 Jul 2024 14:50:08 GMT, Kevin Rushforth <kcr at openjdk.org> wrote:

>> tests/system/src/test/java/test/com/sun/javafx/tk/quantum/SystemMenuBarTest.java line 321:
>> 
>>> 319:             Stage stage = new Stage();
>>> 320:             stage.setScene(new Scene(root));
>>> 321:             stage.show();
>> 
>> I think, a CountDownLatch should be added to make sure that stage is shown before proceeding.
>
> One correction: `Stage.show` is not a blocking call. I haven't looked at it closely, but perhaps what @arapte meant was to suggest that the test wait on a latch that is triggered when the Stage::showing event is delivered? Many of our headful tests do that, but I don't know whether that would be applicable here or not.

Right, it wasn't correct to call it a "blocking call". However, before Stage.show() returns, the contents of the stage are created and their layoutChildren method is invoked (before the WINDOW_SHOWN is fired). 
All Runnables that are scheduled during this method will be executed before the content in the next Util.runAndWait() is executed, so I'm not sure what we should be waiting for?

-------------

PR Review Comment: https://git.openjdk.org/jfx/pull/1283#discussion_r1677141136


More information about the openjfx-dev mailing list