On Fri, 10 Jan 2020 08:17:12 GMT, Ambarish Rapte <ara...@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. Presuming that using a weak reference causes no other issues, the fix looks fine and will resolve the leak. How confident are you that there are no cases where the listener might be prematurely garbage collected? ------------- PR: https://git.openjdk.java.net/jfx/pull/84