RFR: 8349756: Memory leak in PaginationSkin when setting page count / index

Andy Goryachev angorya at openjdk.org
Tue Feb 11 16:56:49 UTC 2025


## Root Cause

Each time a `PaginationSkin.IndicatorButton` gets created it adds two listeners (to the control's `styleClass` property and to the skin's tooltipVisible property) via `ListenerHelper`.  This was not detected by the `SkinMemoryLeakTest` because all listeners got removed correctly upon skin change.

## Solution

Add a single listener to the control's `styleClass` property at the skin level, and insert the call to the skin's `tooltipVisible` property both of which iterate over indicator button to do their thing.

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

Commit messages:
 - memory leak

Changes: https://git.openjdk.org/jfx/pull/1705/files
  Webrev: https://webrevs.openjdk.org/?repo=jfx&pr=1705&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8349756
  Stats: 45 lines in 1 file changed: 27 ins; 13 del; 5 mod
  Patch: https://git.openjdk.org/jfx/pull/1705.diff
  Fetch: git fetch https://git.openjdk.org/jfx.git pull/1705/head:pull/1705

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


More information about the openjfx-dev mailing list