avoid widget is disposed exceptions
authork.luther <k.luther@BGBM11732.bgbm.fu-berlin.de>
Fri, 5 Feb 2016 14:47:23 +0000 (15:47 +0100)
committerk.luther <k.luther@BGBM11732.bgbm.fu-berlin.de>
Fri, 5 Feb 2016 14:47:23 +0000 (15:47 +0100)
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/AbstractCdmEditorViewPart.java

index 9262e041697a4fc3bb5876c0746318a23f69f0c7..10cb9782a546446029c5ebc84b1515d9c8d7236c 100644 (file)
@@ -78,7 +78,11 @@ public abstract class AbstractCdmEditorViewPart extends AbstractCdmViewPart {
     /** {@inheritDoc} */
     @Override
     public void selectionChanged(IWorkbenchPart part, ISelection selection) {
-        if(delaySelection==null){
+       //to avoid widget is disposed exceptions
+        if(getViewer().getControl().isDisposed()){
+            return;
+        }
+       if(delaySelection==null){
             delaySelection = new DelaySelection(part, selection);
         }
         delaySelection.setPart(part);
@@ -88,6 +92,8 @@ public abstract class AbstractCdmEditorViewPart extends AbstractCdmViewPart {
             Display.getCurrent().asyncExec(delaySelection);
         }
     }
+    
+    
 
     /** {@inheritDoc} */
     @Override