RFR: 8294589: MenuBarSkin: memory leak when changing skin

Jeanette Winzenburg fastegal at openjdk.org
Wed Oct 5 11:15:28 UTC 2022


On Tue, 4 Oct 2022 20:15:47 GMT, Andy Goryachev <angorya at openjdk.org> wrote:

>> modules/javafx.controls/src/main/java/com/sun/javafx/scene/control/LambdaMultiplePropertyChangeListenerHandler.java line 183:
>> 
>>> 181:                     consumer.accept(v);
>>> 182:                 }
>>> 183:             });
>> 
>> beware: unregister removes _all_ listeners (of type InvalidationListener) from the given property
>
> this makes no sense!  thank you for pointing it out.
> perhaps we really *ought to* create a better LambdaMultiplePropertyChangeListenerHandler implementation.

well, it _does_ make sense for listeners registered on properties of the control itself (they don't change and are un/registered once) - and that was it was designed for :) What it can't handle (and was not designed for) are dynamic multiple un/registration of listeners.

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

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


More information about the openjfx-dev mailing list