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
MApplication application = ApplicationFactoryImpl.eINSTANCE
				.createApplication();
		MWindow window = BasicFactoryImpl.eINSTANCE.createWindow();
		application.getChildren().add(window);
		application.setSelectedElement(window);
		MPerspectiveStack perspectiveStack = AdvancedFactoryImpl.eINSTANCE
				.createPerspectiveStack();
		window.getChildren().add(perspectiveStack);
		window.setSelectedElement(perspectiveStack);
		MPerspective perspective = AdvancedFactoryImpl.eINSTANCE
				.createPerspective();
		perspectiveStack.getChildren().add(perspective);
		perspectiveStack.setSelectedElement(perspective);
		MPartSashContainer partSashContainer = BasicFactoryImpl.eINSTANCE
				.createPartSashContainer();
		perspective.getChildren().add(partSashContainer);
		perspective.setSelectedElement(partSashContainer);
		MPart partA = BasicFactoryImpl.eINSTANCE.createPart();
		partSashContainer.getChildren().add(partA);
		partSashContainer.setSelectedElement(partA);
		initialize(applicationContext, application);
		getEngine().createGui(window);
		EPartService partService = window.getContext().get(EPartService.class);
		MPart partB = BasicFactoryImpl.eINSTANCE.createPart();
		partService.showPart(partB, PartState.ACTIVATE);
		assertEquals(2, partSashContainer.getChildren().size());
		assertEquals(partA, partSashContainer.getChildren().get(0));
		assertTrue(partSashContainer.getChildren().get(1) instanceof MPartStack);
	}
	public void testShowPart_Bug329310_02() {