On Fri, 30 Sep 2022 09:29:06 GMT, Jeanette Winzenburg <[email protected]> 
wrote:

>> Using new Skin.install() method to properly install and uninstall 
>> inputMethodTextChanged and inputMethodRequests properties on 
>> TextInputControl.
>> 
>> This avoids memory leaks resulting from skin change, as well as honors 
>> user-set properties when installing an uninstalling.
>> 
>> This PR depends on 
>> [JDK-8290844](https://bugs.openjdk.org/browse/JDK-8290844) Skin.install().
>
> modules/javafx.controls/src/main/java/javafx/scene/control/skin/TextInputControlSkin.java
>  line 340:
> 
>> 338:             
>> control.setOnInputMethodTextChanged(inputMethodTextChangedHandler);
>> 339:         }
>> 340: 
> 
> for the record: this pattern is incorrect (no matter _where_ the skin 
> implements it ;) - a skin should not set a singleton event handler on its 
> control (see [JDK-8093590](https://bugs.openjdk.org/browse/JDK-8093590)).
> 
> Not sure how we should procede in this case: moving to install fixes the 
> issue on face value (not overwriting a user-installed handler) but not the 
> incorrect handler registration (should be replaced by an added listener as 
> done in the fix of JDK-8093590) - the latter could be done in a follow-up 
> issue, adding a code comment here?

Thank you.  You are right - we can use addEventHandler().

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

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

Reply via email to