Bug 337002 EPartService leaks previously active part
A reference is kept to the previously active part. This is unnecessary. We only need it to fire events. After the deactivation events have been fired, we should no longer need to keep it lying around.
tests/org.eclipse.e4.ui.tests/src/org/eclipse/e4/ui/tests/application/EPartServiceTest.java
perspectiveStack.setSelectedElement(perspective);
		MPartStack partStackA = BasicFactoryImpl.eINSTANCE.createPartStack();
		perspective.getChildren().add(partStackA);
		perspective.setSelectedElement(partStackA);
		MPlaceholder placeholderA = AdvancedFactoryImpl.eINSTANCE
				.createPlaceholder();
		partStackA.getChildren().add(placeholderA);
		partStackA.setSelectedElement(placeholderA);
		MPart partA = BasicFactoryImpl.eINSTANCE.createPart();
		window.getSharedElements().add(partA);
		partA.setCurSharedRef(placeholderA);
		placeholderA.setRef(partA);
		MPartStack partStackB = BasicFactoryImpl.eINSTANCE.createPartStack();
		perspective.getChildren().add(partStackB);
		initialize(applicationContext, application);
		getEngine().createGui(window);
		MPart partB = BasicFactoryImpl.eINSTANCE.createPart();
		partB.setToBeRendered(false);
		partStackB.getChildren().add(partB);
		partStackB.setSelectedElement(null);
		EPartService partService = window.getContext().get(EPartService.class);
		partService.showPart(partB, PartState.VISIBLE);
		assertNotNull(partStackB.getSelectedElement());
		assertEquals(partB, partStackB.getSelectedElement());
	}
	public void testShowPart_Bug320578_A() {
		MApplication application = ApplicationFactoryImpl.eINSTANCE
				.createApplication();
		MPartDescriptor partDescriptor = org.eclipse.e4.ui.model.application.descriptor.basic.impl.BasicFactoryImpl.eINSTANCE
				.createPartDescriptor();