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
}
	public void testActivate_Bug326300() {
		MApplication application = ApplicationFactoryImpl.eINSTANCE
				.createApplication();
		MWindow windowA = BasicFactoryImpl.eINSTANCE.createWindow();
		application.getChildren().add(windowA);
		application.setSelectedElement(windowA);
		MPart partA = BasicFactoryImpl.eINSTANCE.createPart();
		windowA.getChildren().add(partA);
		windowA.setSelectedElement(partA);
		MPart partB = BasicFactoryImpl.eINSTANCE.createPart();
		windowA.getChildren().add(partB);
		MWindow windowB = BasicFactoryImpl.eINSTANCE.createWindow();
		application.getChildren().add(windowB);
		MPart partC = BasicFactoryImpl.eINSTANCE.createPart();
		windowB.getChildren().add(partC);
		windowB.setSelectedElement(partC);
		initialize(applicationContext, application);
		getEngine().createGui(windowA);
		getEngine().createGui(windowB);
		windowA.getContext().get(EPartService.class).activate(partB);
		assertEquals(windowA, application.getSelectedElement());
		assertEquals(partB, windowA.getContext().get(EPartService.class)
				.getActivePart());
		windowB.getContext().get(EPartService.class).activate(partC);
		assertEquals(windowB, application.getSelectedElement());
		assertEquals(partC, windowB.getContext().get(EPartService.class)
				.getActivePart());
		windowA.getContext().get(EPartService.class).activate(partB);
		assertEquals(windowA, application.getSelectedElement());