RFR: 8227619: Potential memory leak in javafx.scene.control.ListView
kcr at openjdk.java.net
Sat Feb 8 17:08:26 UTC 2020
On Fri, 10 Jan 2020 08:17:12 GMT, Ambarish Rapte <arapte at openjdk.org> wrote:
> `ListView` does not get GCed because `SelectedItemsReadOnlyObservableList` adds a `ListChangeListener` to the (`ObservableList`) items of `ListView`.
> Adding a `WeakListChangeListener` instead of `ListChangeListener` fixes the issue.
> Added a unit test and verified that existing tests do not fail due to this change.
OK, this makes sense. Somewhat related to this, I see that `ListViewBitSetSelectionModel` is using a `WeakInvalidationListener` in order to avoid a similar problem.
Marked as reviewed by kcr (Lead).
More information about the openjfx-dev