Bug 327933 Unrendering container with invalid selectedElement can cause target element to be unrendered
bundles/org.eclipse.e4.ui.workbench.swt/src/org/eclipse/e4/ui/internal/workbench/swt/PartRenderingEngine.java
if (renderer != null) {
			if (element instanceof MElementContainer<?>) {
				MElementContainer<MUIElement> container = (MElementContainer<MUIElement>) element;
				MUIElement selectedElement = container.getSelectedElement();
				for (MUIElement child : container.getChildren()) {
					
					if (child != selectedElement) {
						removeGui(child);
					}
				}
				if (selectedElement != null) {
					
					removeGui(selectedElement);
				}
			}
			renderer.disposeWidget(element);
			
			if (element instanceof MContribution) {
				IEclipseContext parentContext = renderer.getContext(element);
				ContextInjectionFactory.uninject(
						((MContribution) element).getObject(), parentContext);
				((MContribution) element).setObject(null);
			}
			
			if (element instanceof MContext) {
				clearContext((MContext) element);
			}
		}
		if (removeRoot == element)