RFR: 8241455: ChoiceBox - memory leak on replacing selectionModel

Ambarish Rapte arapte at openjdk.java.net
Thu Mar 26 12:35:58 UTC 2020


On Thu, 26 Mar 2020 12:25:14 GMT, Kevin Rushforth <kcr at openjdk.org> wrote:

>> I would like to widen the issue (and change this pull request accordingly) to include memory leaks of introduced
>> selection- and focusModels in other controls that are caused by the basically same reason, that is strong references
>> via listeners to controls' properties. The fix would be the same as well, that is wrap the listeners into
>> weakXXListeners and register these.  The models suggested to include here:
>> - TreeView: selection- and focusModel
>> - TreeTableView: focusModel
>> - TabPane: selectionModel
>> 
>> Not included would be memory leaks introduced by whacky listening of ChoiceBoxSkin and TabPaneSkin to properties of the
>> selectionModel. The former will (most probably) be fixed as a side-effect of
>> https://bugs.openjdk.java.net/browse/JDK-8087555 (which I intend to take, if Ajit agrees :), will open a separate issue
>> for the latter.   The extended fix here will have tests for replacing selection/focusModels with/out a skin registered
>> for all controls having the respective models.   Not entirely certain about the formal procedure (locally fix and tests
>> are - nearly, pending some cleanup - ready). Simply change titles, rebase and push again?
>
> If Ambarish and Ajit are OK with this, then the procedure would be as you guessed: change the title of both the JBS bug
> and then this PR and push your new fix (with or without rebasing would be fine).

That is good idea to combine all similarly affected selection models. I think rebase won't be required just updating
the PR with more commits should be good enough.

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

PR: https://git.openjdk.java.net/jfx/pull/148


More information about the openjfx-dev mailing list