add dispose check in case view is closed while loading db

This commit is contained in:
Eyck Jentzsch 2021-02-24 08:46:19 +00:00
parent 7af5593fd4
commit 0e49a68e09
1 changed files with 6 additions and 4 deletions

View File

@ -133,10 +133,11 @@ public class DesignBrowser {
treeViewer.refresh(); treeViewer.refresh();
}); });
} else if(IHierNode.LOADING_FINISHED.equals(evt.getPropertyName())) { } else if(IHierNode.LOADING_FINISHED.equals(evt.getPropertyName())) {
treeViewer.getTree().getDisplay().asyncExec(() -> { if(!treeViewer.getControl().isDisposed())
treeViewer.update(waveformViewerPart.getDatabase(), null); treeViewer.getTree().getDisplay().asyncExec(() -> {
DesignBrowser.this.updateButtons(); treeViewer.update(waveformViewerPart.getDatabase(), null);
}); DesignBrowser.this.updateButtons();
});
} }
}; };
@ -596,6 +597,7 @@ public class DesignBrowser {
* Apply. * Apply.
*/ */
public void apply() { public void apply() {
if(treeViewer.getControl().isDisposed()) return;
treeViewer.setExpandedElements(expandedElements); treeViewer.setExpandedElements(expandedElements);
treeViewer.setSelection(treeSelection, true); treeViewer.setSelection(treeSelection, true);
txTableViewer.setSelection(tableSelection, true); txTableViewer.setSelection(tableSelection, true);