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
stack.getChildren().add(partA);
		stack.setSelectedElement(partA);
		MPart partB = BasicFactoryImpl.eINSTANCE.createPart();
		partB.setToBeRendered(false);
		stack.getChildren().add(partB);
		initialize(applicationContext, application);
		getEngine().createGui(window);
		window.getContext().get(EPartService.class).hidePart(partA, true);
		
		
		assertNull(stack.getSelectedElement());
	}
	private void testHidePart_Bug327044(boolean force) {
		MApplication application = ApplicationFactoryImpl.eINSTANCE
				.createApplication();
		MWindow window = BasicFactoryImpl.eINSTANCE.createWindow();
		application.getChildren().add(window);
		application.setSelectedElement(window);
		MPartStack stack = BasicFactoryImpl.eINSTANCE.createPartStack();
		window.getChildren().add(stack);
		window.setSelectedElement(stack);
		MPart part = BasicFactoryImpl.eINSTANCE.createPart();
		stack.getChildren().add(part);
		stack.setSelectedElement(part);
		initialize(applicationContext, application);
		getEngine().createGui(window);
		window.getContext().get(EPartService.class).hidePart(part, force);
		assertNull(stack.getSelectedElement());
	}
	public void testHidePart_Bug327044_True() {