Bug 335889 E4Application#stop cannot shutdown the workbench
E4Application#stop() currently does nothing. As a result, if you trigger a shutdown of the OSGi runtime programmatically (e.g., getBundle(0).stop()), the UI workbench is not closed. Any subsequent clicking or interaction with the UI workbench triggers a cascade of errors. I think E4Application should hold onto the workbench in a field. The stop() method should call workbench.close().
bundles/org.eclipse.e4.ui.workbench.swt/src/org/eclipse/e4/ui/internal/workbench/swt/E4Application.java
public E4Workbench createE4Workbench(
			IApplicationContext applicationContext, final Display display) {
		args = (String[]) applicationContext.getArguments().get(
				IApplicationContext.APPLICATION_ARGS);
		IEclipseContext appContext = createDefaultContext();
		appContext.set(Realm.class, SWTObservables.getRealm(display));
		appContext.set(UISynchronize.class, new UISynchronize() {
			public void syncExec(Runnable runnable) {
				display.syncExec(runnable);
			}
			public void asyncExec(Runnable runnable) {
				display.asyncExec(runnable);
			}
		});
		appContext.set(IApplicationContext.class, applicationContext);
		
		if (!appContext
				.containsKey("org.eclipse.e4.ui.workbench.modeling.EModelService")) {
			throw new IllegalStateException(
					"Core services not available. Please make sure that a declarative service implementation (such as the bundle 'org.eclipse.equinox.ds') is available!");
		}
		
		IContributionFactory factory = (IContributionFactory) appContext
				.get(IContributionFactory.class.getName());
		
		
		String lifeCycleURI = getArgValue(E4Workbench.LIFE_CYCLE_URI_ARG,
				applicationContext, false);
		if (lifeCycleURI != null) {
			lcManager = factory.create(lifeCycleURI, appContext);