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
MPart partB1 = BasicFactoryImpl.eINSTANCE.createPart();
		stackB.getChildren().add(partB1);
		stackB.setSelectedElement(partB1);
		MPlaceholder placeholderPartB2 = AdvancedFactoryImpl.eINSTANCE
				.createPlaceholder();
		placeholderPartB2.setRef(partB2);
		partB2.setCurSharedRef(placeholderPartB2);
		stackB.getChildren().add(placeholderPartB2);
		initialize(applicationContext, application);
		getEngine().createGui(window);
		EPartService partService = window.getContext().get(EPartService.class);
		partService.activate(partB1);
		partService.activate(partB2);
		partService.hidePart(partB2);
		assertEquals(partB1, stackB.getSelectedElement());
		assertEquals(partB1, partService.getActivePart());
		partService.hidePart(partB1);
		assertNull(stackB.getSelectedElement());
		assertEquals(partA, partService.getActivePart());
	}
	public void testHidePart_ActivationHistory14() {
		MApplication application = ApplicationFactoryImpl.eINSTANCE
				.createApplication();
		MWindow window = BasicFactoryImpl.eINSTANCE.createWindow();
		application.getChildren().add(window);
		application.setSelectedElement(window);
		MPart partA = BasicFactoryImpl.eINSTANCE.createPart();
		window.getSharedElements().add(partA);
		MPart partB = BasicFactoryImpl.eINSTANCE.createPart();
		window.getSharedElements().add(partB);