RFR: 8240506: TextFieldSkin/Behavior: misbehavior on switching skin
Jeanette Winzenburg
fastegal at openjdk.java.net
Thu Jun 17 12:47:36 UTC 2021
The issue is about memory leaks and side-effects (like NPEs) when switching skins.
Details (copied from issue for convenience):
memory leak in TextInputControlBehavior:
- listener accidentally added twice (removed once)
- keyPad mappings not properly installed/disposed
memory leak TextFieldBehavior:
- listeners to scene/focusOwner property not removed,
memory leak in TextInputControlSkin:
- event handlers related to inputMethods not removed
issues in TextFieldSkin:
- memory leak due to behavior leaking
- memory leaks due to manually added change/invalidation listeners that are not removed
- memory leaks due to not removing children with strong references to skin
- side-effects (f.i. NPEs) due to listeners/bindings that are still active after dispose
Fix was to properly install/remove those listeners/handlers. Added tests that failed/passed before/after the fix, respectively, also added tests passing before that must pass after the fix.
-------------
Commit messages:
- 8240506: TextFieldSkin/Behavior: misbehavior on switching skin
Changes: https://git.openjdk.java.net/jfx/pull/534/files
Webrev: https://webrevs.openjdk.java.net/?repo=jfx&pr=534&range=00
Issue: https://bugs.openjdk.java.net/browse/JDK-8240506
Stats: 753 lines in 10 files changed: 687 ins; 38 del; 28 mod
Patch: https://git.openjdk.java.net/jfx/pull/534.diff
Fetch: git fetch https://git.openjdk.java.net/jfx pull/534/head:pull/534
PR: https://git.openjdk.java.net/jfx/pull/534
More information about the openjfx-dev
mailing list