ItEr58S18CUEscaladoPantallaCargaRecursosEmpresaItEr57S10: Solved a bug that deleted the name filter listener while it was still in use.
The garbage collector deleted it because there were no strong references, but it could be still in use.
This commit is contained in:
parent
df27ede355
commit
bac99b74da
1 changed files with 11 additions and 3 deletions
|
|
@ -193,15 +193,23 @@ public class ResourceLoadController implements Composer {
|
|||
addNameFilterListener();
|
||||
}
|
||||
|
||||
private void addNameFilterListener() {
|
||||
resourcesLoadPanel.addNameFilterListener(new IPaginationFilterChangedListener() {
|
||||
/*
|
||||
* This object is stored in an attribute to keep one reference to it, so the
|
||||
* garbage collector doesn't get rid of it. It's necessary because it is stored
|
||||
* by ResourcesLoadPanel using weak references.
|
||||
*/
|
||||
private IPaginationFilterChangedListener keepAlivePaginationListener =
|
||||
new IPaginationFilterChangedListener() {
|
||||
@Override
|
||||
public void filterChanged(int initialPosition) {
|
||||
resourceLoadModel.setPageFilterPosition(initialPosition);
|
||||
reload(currentFilterByResources);
|
||||
addSchedulingScreenListeners();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
private void addNameFilterListener() {
|
||||
resourcesLoadPanel.addNameFilterListener(keepAlivePaginationListener);
|
||||
}
|
||||
|
||||
private void addSchedulingScreenListeners() {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue