RFR: 8294589: MenuBarSkin: memory leak when changing skin [v15]

John Hendrikx jhendrikx at openjdk.org
Thu Dec 1 17:55:34 UTC 2022


On Wed, 30 Nov 2022 23:28:02 GMT, Andy Goryachev <angorya at openjdk.org> wrote:

>> modules/javafx.controls/src/main/java/javafx/scene/control/skin/MenuBarSkin.java line 374:
>> 
>>> 372: 
>>> 373:                 // When the parent window looses focus - menu selection should be cleared
>>> 374:                 sceneListenerHelper.addChangeListener(scene.windowProperty(), true, (sr, oldw, w) -> {
>> 
>> Suggestion:
>> 
>>                 sceneListenerHelper.addChangeListener(scene.windowProperty(), true, w -> {
>
> my version does not create extra object(s).

Hm, I thought that the number of objects created is the same, either a `ChangeListener` is created and then wrapped in `ChLi` or a `Consumer` is created and wrapped in `ChLi`.

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

PR: https://git.openjdk.org/jfx/pull/906


More information about the openjfx-dev mailing list