[Rev 01] RFR: 8241455: Memory leak on replacing selection/focusModel

Ambarish Rapte arapte at openjdk.java.net
Thu Apr 2 11:31:52 UTC 2020


On Thu, 2 Apr 2020 09:12:55 GMT, Jeanette Winzenburg <fastegal at openjdk.org> wrote:

>> modules/javafx.controls/src/test/java/test/javafx/scene/control/SelectionFocusModelMemoryTest.java line 285:
>> 
>>> 284:         }
>>> 285:         root.getChildren().add(node);
>>> 286:         if (!stage.isShowing()) {
>> 
>> Will it be good to add a call to `root.getChildren().removeAll()` before adding the `node` to `root` ?
>
>> 
>> Will it be good to add a call to `root.getChildren().removeAll()` before adding the `node` to `root` ?
> 
> hmm .. don't think that it's necessary to clear out other children: the thing that actually matters is that the control
> goes active in the scenegraph and has a skin attached. Can you think of any context where any of the tests might get
> whacky if there are more than one nodes in the root?   Actually, that's a pattern (*cough, read that's more or less
> c&p'ed) I use in other tests, where it sometimes is allowed and expected that there are more than one.

Agree that It would not cause any problem in test execution.

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

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


More information about the openjfx-dev mailing list