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

Johan Vos jvos at openjdk.org
Tue Jul 9 09:20:40 UTC 2024


On Wed, 19 Jun 2024 14:25:52 GMT, Ambarish Rapte <arapte at openjdk.org> wrote:

>> Johan Vos has updated the pull request incrementally with two additional commits since the last revision:
>> 
>>  - process more reviewer comments
>>  - Process reviewer comments
>
> 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.

I don't completely understand this. The stage.show() is a blocking call, and the runnable that it might schedule will be executed before other runnables (part of the processing in the rest of the method) are scheduled.
I added a CountDownLatch at the end of the processing, so that we allow for the processing to run into exceptions before we finalize the test.
Does that make sense?

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

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


More information about the openjfx-dev mailing list