Bug 299554 Application.xmi without Window
bundles/org.eclipse.e4.ui.workbench.swt/src/org/eclipse/e4/ui/workbench/swt/internal/PartRenderingEngine.java
record.refCount--;
				needsDispose = record.refCount == 0;
			}
		}
		AbstractPartRenderer factory = getFactoryFor(element);
		assert (factory != null);
		MUIElement parent = element.getParent();
		AbstractPartRenderer parentFactory = parent != null ? getFactoryFor(parent)
				: null;
		if (parentFactory != null) {
			parentFactory.hideChild(element.getParent(), element);
		}
		if (factory != null && needsDispose)
			factory.disposeWidget(element);
		else
			System.out.println("Null factory in removeGui");
		
		if (element instanceof MContext) {
			MContext ctxt = (MContext) element;
			IEclipseContext lclContext = ctxt.getContext();
			ctxt.setContext(null);
			if (lclContext instanceof IDisposable) {
				((IDisposable) lclContext).dispose();
			}
		}
	}
	protected Object createWidget(MUIElement element, Object parent) {
		
		if (element.getId() != null && element.getId().length() > 0) {
			RenderingRecord record = renderedWidgets.get(element.getId());