Simplify CMS app deployment.
[gpl/argeo-suite.git] / org.argeo.app.ui / src / org / argeo / app / ui / SuiteApp.java
index 4c4f1bb968b1bf8e012575216256c1bbb147d8e9..f6770dbac1302d30915f1bdb04bd22a721273fe4 100644 (file)
@@ -122,8 +122,9 @@ public class SuiteApp extends AbstractCmsApp implements EventHandler {
 
        public void destroy(Map<String, Object> properties) {
                for (SuiteUi ui : managedUis.values())
-                       if (!ui.isDisposed())
-                               ui.dispose();
+                       if (!ui.isDisposed()) {
+                               ui.getDisplay().syncExec(() -> ui.dispose());
+                       }
                if (log.isDebugEnabled())
                        log.info("Argeo Suite App stopped");
 
@@ -321,7 +322,6 @@ public class SuiteApp extends AbstractCmsApp implements EventHandler {
                        if (types.size() == 0)
                                throw new IllegalArgumentException("No type found for " + context + " (" + listTypes(context) + ")");
                        String type = types.iterator().next();
-                       // FIXME deals with multiple types
                        if (!byType.containsKey(type))
                                throw new IllegalArgumentException("No component found for " + context + " with type " + type);
                        return byType.get(type).get();