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
initialize(applicationContext, application);
		
		getEngine().createGui(window);
		EPartService partService = (EPartService) window.getContext().get(
				EPartService.class.getName());
		partService.hidePart(part, force);
		assertEquals(force, !perspective.getChildren().contains(placeholder));
	}
	public void testHidePart_Bug325148_True() {
		testHidePart_Bug325148(true);
	}
	public void testHidePart_Bug325148_False() {
		testHidePart_Bug325148(false);
	}
	private void testHidePart_Bug325148_Unrendered(boolean force) {
		MApplication application = ApplicationFactoryImpl.eINSTANCE
				.createApplication();
		MPartDescriptor partDescriptor = org.eclipse.e4.ui.model.application.descriptor.basic.impl.BasicFactoryImpl.eINSTANCE
				.createPartDescriptor();
		partDescriptor.setElementId("partId");
		partDescriptor.setCategory("category");
		application.getDescriptors().add(partDescriptor);
		final MWindow window = BasicFactoryImpl.eINSTANCE.createWindow();
		application.getChildren().add(window);
		application.setSelectedElement(window);
		
		MPartStack stack = BasicFactoryImpl.eINSTANCE.createPartStack();
		stack.setElementId("category");
		window.getChildren().add(stack);
		window.setSelectedElement(stack);