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
partA.setInputURI("http://www.eclipse.org");
		window.getChildren().add(partA);
		MWindow detachedWindow = BasicFactoryImpl.eINSTANCE.createWindow();
		perspective.getWindows().add(detachedWindow);
		MInputPart partB = BasicFactoryImpl.eINSTANCE.createInputPart();
		partB.setInputURI("http://www.eclipse.org");
		detachedWindow.getChildren().add(partB);
		detachedWindow.setSelectedElement(partB);
		MInputPart partC = BasicFactoryImpl.eINSTANCE.createInputPart();
		partC.setInputURI("http://www.eclipse.org");
		detachedWindow.getChildren().add(partC);
		initialize(applicationContext, application);
		getEngine().createGui(window);
		EPartService partService = window.getContext().get(EPartService.class);
		Collection<MInputPart> parts = partService
				.getInputParts("http://www.eclipse.org");
		assertEquals(3, parts.size());
		assertTrue(parts.contains(partA));
		assertTrue(parts.contains(partB));
		assertTrue(parts.contains(partC));
	}
	public void testGetInputParts() {
		final String uri1 = "file:///a.txt";
		final String uri2 = "file:///b.txt";
		MApplication application = ApplicationFactoryImpl.eINSTANCE
				.createApplication();
		MWindow window = BasicFactoryImpl.eINSTANCE.createWindow();
		application.getChildren().add(window);
		application.setSelectedElement(window);
		MPart part = BasicFactoryImpl.eINSTANCE.createPart();