[CLIENT] #16 : ajout d'une méthode delete() aux clss du ProductManagerScreen, pour permettre la garbage-collection des obj durant l'exec du soft

This commit is contained in:
Notmoo-PC\Notmoo 2018-01-24 21:53:38 +01:00
parent 9b847e61d0
commit 73e91c12c6
5 changed files with 23 additions and 1 deletions

View File

@ -200,13 +200,13 @@ class StockScreenView implements IFXComponent {
.collect(Collectors.toList()); .collect(Collectors.toList());
Platform.runLater(()->{ Platform.runLater(()->{
mainPane.getChildren().removeAll(toRemove); mainPane.getChildren().removeAll(toRemove);
currentDetailScreen.delete();
currentDetailScreen = null; currentDetailScreen = null;
}); });
} }
} }
boolean isDetailScreenCreationPossible() { boolean isDetailScreenCreationPossible() {
System.out.println("test creation possible : ");
return currentDetailScreen!=null && currentDetailScreen.isCreationPossible(); return currentDetailScreen!=null && currentDetailScreen.isCreationPossible();
} }

View File

@ -53,4 +53,13 @@ public class ProductManagerScreen implements IFXCreatorComponent<Product>, IFXVa
public Product getInitialValueSnapshot(){ public Product getInitialValueSnapshot(){
return new Product(model.getInitialData()); return new Product(model.getInitialData());
} }
public void delete(){
model.delete();
view.delete();
ctrl.delete();
view = null;
ctrl = null;
model = null;
}
} }

View File

@ -90,4 +90,10 @@ class ProductManagerScreenController {
void onSellableStateChanged(boolean oldVal, boolean newVal) { void onSellableStateChanged(boolean oldVal, boolean newVal) {
model.setSellable(newVal); model.setSellable(newVal);
} }
public void delete() {
view = null;
model = null;
listenerList = null;
}
} }

View File

@ -121,4 +121,8 @@ class ProductManagerScreenModel {
Product getInitialData(){ Product getInitialData(){
return initialData; return initialData;
} }
public void delete() {
}
} }

View File

@ -209,4 +209,7 @@ class ProductManagerScreenView implements IFXComponent {
productComponentsListView.getItems().addAll(productCollection); productComponentsListView.getItems().addAll(productCollection);
}); });
} }
public void delete() {
ctrl = null;
}
} }