From: lempinen Date: Mon, 15 Mar 2010 15:48:11 +0000 (+0000) Subject: Checks for isdisposed in asyncexecs X-Git-Tag: simantics-1.0~25 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=34de4f6fe60cecd07bf560d74650aacf6d081842;p=simantics%2Fsysdyn.git Checks for isdisposed in asyncexecs git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@14935 ac1ea38d-2e2b-0410-8846-a27921b304fc --- diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/editor/SysdynDiagramEditor.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/editor/SysdynDiagramEditor.java index 3333f394..6a881819 100644 --- a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/editor/SysdynDiagramEditor.java +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/editor/SysdynDiagramEditor.java @@ -220,7 +220,8 @@ public class SysdynDiagramEditor extends ResourceEditorPart { @Override public void run() { - selectionProvider.setSelection(new StructuredSelection(resources)); + if(!composite.isDisposed()) + selectionProvider.setSelection(new StructuredSelection(resources)); } }); diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/equation/EquationView.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/equation/EquationView.java index 9a237cd0..512dba3e 100644 --- a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/equation/EquationView.java +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/equation/EquationView.java @@ -242,6 +242,8 @@ public class EquationView extends ViewPart implements ISelectionListener { @Override public void run(){ + if(isDisposed()) + return; if(result.isVariable) { unitSelector.setEnabled(true); expressionController.setEnabled(true); @@ -269,7 +271,7 @@ public class EquationView extends ViewPart implements ISelectionListener { expressionController.setEnabled(false); expressionComposite.setEnabled(false); nameComposite.setEnabled(false); - + unitSelector.clear(); // empty units shortcutTabs.updateTables(variable); expressionController.setExpressionTypes(null); @@ -336,8 +338,10 @@ public class EquationView extends ViewPart implements ISelectionListener { @Override public void run() { - expressionComposite.replaceSelection(var); - validateExpressionFields(); + if(expressionComposite!= null && !expressionComposite.isDisposed()) { + expressionComposite.replaceSelection(var); + validateExpressionFields(); + } } }); }