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
MWindow window = application.getChildren().get(0);
		getEngine().createGui(window);
		EPartService partService = (EPartService) window.getContext().get(
				EPartService.class.getName());
		MPlaceholder placeholderA = partService
				.createSharedPart("partId", true);
		MPlaceholder placeholderB = partService
				.createSharedPart("partId", true);
		assertEquals(2, window.getSharedElements().size());
		MPart part1 = (MPart) window.getSharedElements().get(0);
		MPart part2 = (MPart) window.getSharedElements().get(1);
		assertTrue(part1 == placeholderA.getRef()
				|| part1 == placeholderB.getRef());
		assertTrue(part2 == placeholderA.getRef()
				|| part2 == placeholderB.getRef());
	}
	public void testShowPart_Id_ACTIVATE() {
		MApplication application = createApplication(1, new String[1][0]);
		MWindow window = application.getChildren().get(0);
		MPartDescriptor partDescriptor = org.eclipse.e4.ui.model.application.descriptor.basic.impl.BasicFactoryImpl.eINSTANCE
				.createPartDescriptor();
		partDescriptor.setElementId("partId");
		application.getDescriptors().add(partDescriptor);
		getEngine().createGui(window);
		EPartService partService = (EPartService) window.getContext().get(
				EPartService.class.getName());
		MPart part = partService.showPart("partId", PartState.ACTIVATE);
		assertNotNull(part);
		assertEquals("partId", part.getElementId());
		assertEquals(part, partService.getActivePart());