felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dsav...@apache.org
Subject svn commit: r800858 - /felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/ui/eclipse/ui/editors/project/ResourceBuildSection.java
Date Tue, 04 Aug 2009 15:57:41 GMT
Author: dsavage
Date: Tue Aug  4 15:57:41 2009
New Revision: 800858

URL: http://svn.apache.org/viewvc?rev=800858&view=rev
Log:
check if widget is disposed before calling refresh FELIX-1452

Modified:
    felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/ui/eclipse/ui/editors/project/ResourceBuildSection.java

Modified: felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/ui/eclipse/ui/editors/project/ResourceBuildSection.java
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/ui/eclipse/ui/editors/project/ResourceBuildSection.java?rev=800858&r1=800857&r2=800858&view=diff
==============================================================================
--- felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/ui/eclipse/ui/editors/project/ResourceBuildSection.java
(original)
+++ felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/ui/eclipse/ui/editors/project/ResourceBuildSection.java
Tue Aug  4 15:57:41 2009
@@ -20,6 +20,8 @@
 package org.apache.felix.sigil.ui.eclipse.ui.editors.project;
 
 
+import java.util.concurrent.atomic.AtomicBoolean;
+
 import org.apache.felix.sigil.eclipse.SigilCore;
 import org.apache.felix.sigil.eclipse.model.project.ISigilProjectModel;
 import org.apache.felix.sigil.model.eclipse.ISigilBundle;
@@ -37,6 +39,7 @@
 import org.eclipse.jface.viewers.CheckboxTreeViewer;
 import org.eclipse.jface.viewers.ICheckStateListener;
 import org.eclipse.swt.SWT;
+import org.eclipse.swt.SWTException;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Event;
 import org.eclipse.swt.widgets.Link;
@@ -179,18 +182,27 @@
         markDirty();
     }
 
-
+    private AtomicBoolean disposed = new AtomicBoolean();
+    
     @Override
     public void dispose()
     {
-        super.dispose();
+        disposed.set( true );
         SigilCore.getDefault().getPreferenceStore().removePropertyChangeListener( this );
+        super.dispose();
     }
 
 
     public void propertyChange( PropertyChangeEvent event )
     {
-        resourcesFilter.loadExclusions();
-        viewer.refresh();
+        if ( !disposed.get() ) {
+            resourcesFilter.loadExclusions();
+            try {
+                viewer.refresh();
+            }
+            catch (SWTException e) {
+                // can happen on dispose
+            }
+        }
     }
 }



Mime
View raw message