]> gerrit.simantics Code Review - simantics/sysdyn.git/commitdiff
Checks for isdisposed in asyncexecs
authorlempinen <lempinen@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Mon, 15 Mar 2010 15:48:11 +0000 (15:48 +0000)
committerlempinen <lempinen@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Mon, 15 Mar 2010 15:48:11 +0000 (15:48 +0000)
git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@14935 ac1ea38d-2e2b-0410-8846-a27921b304fc

org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/editor/SysdynDiagramEditor.java
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/equation/EquationView.java

index 3333f3949f0872fae784cd692108ca2016f07c93..6a881819b4cc67db5f12c6fb01ec299e9ef173c7 100644 (file)
@@ -220,7 +220,8 @@ public class SysdynDiagramEditor extends ResourceEditorPart {
 \r
                             @Override\r
                             public void run() {\r
-                                selectionProvider.setSelection(new StructuredSelection(resources));\r
+                                if(!composite.isDisposed())\r
+                                    selectionProvider.setSelection(new StructuredSelection(resources));\r
                             }\r
                             \r
                         });\r
index 9a237cd02a9668febb3b801c5edb91d58a568a83..512dba3e179b244495cd50e692d903f11dc75c03 100644 (file)
@@ -242,6 +242,8 @@ public class EquationView extends ViewPart implements ISelectionListener {
 \r
                                         @Override\r
                                         public void run(){    \r
+                                            if(isDisposed())\r
+                                                return;\r
                                             if(result.isVariable) {\r
                                                 unitSelector.setEnabled(true);\r
                                                 expressionController.setEnabled(true);\r
@@ -269,7 +271,7 @@ public class EquationView extends ViewPart implements ISelectionListener {
                                                 expressionController.setEnabled(false);\r
                                                 expressionComposite.setEnabled(false);\r
                                                 nameComposite.setEnabled(false);\r
-                                                \r
+\r
                                                 unitSelector.clear(); // empty units\r
                                                 shortcutTabs.updateTables(variable);\r
                                                 expressionController.setExpressionTypes(null);   \r
@@ -336,8 +338,10 @@ public class EquationView extends ViewPart implements ISelectionListener {
 \r
                             @Override\r
                             public void run() {\r
-                                expressionComposite.replaceSelection(var);\r
-                                validateExpressionFields();\r
+                                if(expressionComposite!= null && !expressionComposite.isDisposed()) {\r
+                                    expressionComposite.replaceSelection(var);\r
+                                    validateExpressionFields();\r
+                                }\r
                             }\r
                         });\r
                     }\r