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
* Test to ensure that calling bringToTop(MPart) will change the active part
	 * if the active part is obscured by the part that's being brought to top.
	 */
	public void testBringToTop_ActivationChanges01() {
		MApplication application = ApplicationFactoryImpl.eINSTANCE
				.createApplication();
		MWindow window = BasicFactoryImpl.eINSTANCE.createWindow();
		application.getChildren().add(window);
		MPartStack partStackA = BasicFactoryImpl.eINSTANCE.createPartStack();
		MPart partFrontA = BasicFactoryImpl.eINSTANCE.createPart();
		MPart partBackA = BasicFactoryImpl.eINSTANCE.createPart();
		partStackA.getChildren().add(partFrontA);
		partStackA.getChildren().add(partBackA);
		window.getChildren().add(partStackA);
		MPartStack partStackB = BasicFactoryImpl.eINSTANCE.createPartStack();
		MPart partFrontB = BasicFactoryImpl.eINSTANCE.createPart();
		MPart partBackB = BasicFactoryImpl.eINSTANCE.createPart();
		partStackB.getChildren().add(partFrontB);
		partStackB.getChildren().add(partBackB);
		window.getChildren().add(partStackB);
		partStackA.setSelectedElement(partFrontA);
		partStackB.setSelectedElement(partFrontB);
		window.setSelectedElement(partStackA);
		application.setSelectedElement(window);
		initialize(applicationContext, application);
		getEngine().createGui(window);
		EPartService partService = (EPartService) window.getContext().get(
				EPartService.class.getName());
		partService.activate(partFrontA);
		assertEquals(partFrontA, partService.getActivePart());