Hi guys,
I'm using Javafx to develop an application. I'm creating views with fxml. I'm experiencing some memory problems perhaps because I can not understand the life cycle of the controller and the views.
For example, the listeners that I add in the controller to the components of ui, must be removed before going out from the view?
And in a case in which there is a inner listener? For example:
tabellaClienti.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<Cliente>() {
@Override
public void changed(ObservableValue<? extends Cliente> property, Cliente oldSelection, Cliente newSelection) {
seleziona(newSelection);
}
});
in this case the listener when is destroyed?
I'm experiencing that I got the same view (with all components) in memory many times.
There is a guideline to follow to be sure to avoid making mistakes?
Thanks!