Commit e9ca43be authored by Simon Barner's avatar Simon Barner
Browse files

Fix NPE in dispose() when the edited AllocationTable is deleted.

refs 2950
parent 3c642693
......@@ -45,6 +45,12 @@ import org.fortiss.tooling.kernel.model.IProjectRootElement;
*/
public abstract class ModelListenerEditorBase<T extends EObject> extends GEFEditorBase<T> {
/**
* {@link FileProject} to which {@link #fileProjectListener} is registered. It cannot be
* determined in {@link #dispose()} when the {@link #editedObject} has been deleted.
*/
private FileProject fileProject;
/**
* Adapter to watch a {@link FileProject} for added / removed / renamed
* {@link IProjectRootElement}s and added / removed / renamed entities.
......@@ -153,7 +159,7 @@ public abstract class ModelListenerEditorBase<T extends EObject> extends GEFEdit
/** {@inheritDoc} */
@Override
public void createPartControl(Composite parent) {
FileProject fileProject = getFileProject(editedObject);
fileProject = getFileProject(editedObject);
fileProject.eAdapters().add(fileProjectListener);
}
......@@ -161,8 +167,6 @@ public abstract class ModelListenerEditorBase<T extends EObject> extends GEFEdit
@Override
public void dispose() {
super.dispose();
FileProject fileProject = getFileProject(editedObject);
fileProject.eAdapters().remove(fileProjectListener);
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment