-
Bug
-
Resolution: Fixed
-
P4
-
7u6
BooleanExpression (and other observable values) created by methods not(), and(), or() etc.. are not cleaned from memory until all of the objects used during its creating are cleaned.
showAll = new SimpleBooleanProperty();
ToggleButton tb = new ToggleButton();
tb.visibleProperty().bind(tb.selectedProperty().or(showAll));
tb.visibleProperty().unbind();
tb = null;
The BooleanExpression in the third line of aforementioned code stays in memory untill the showAll property is cleaned. It also holds all the objects used during its creating. That means the toggle button stays in memory as well.
I'm not sure whether it is bug or just strange behavior, but it makes these methods completely unusable and it should be at least mentioned in documentation.
showAll = new SimpleBooleanProperty();
ToggleButton tb = new ToggleButton();
tb.visibleProperty().bind(tb.selectedProperty().or(showAll));
tb.visibleProperty().unbind();
tb = null;
The BooleanExpression in the third line of aforementioned code stays in memory untill the showAll property is cleaned. It also holds all the objects used during its creating. That means the toggle button stays in memory as well.
I'm not sure whether it is bug or just strange behavior, but it makes these methods completely unusable and it should be at least mentioned in documentation.