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
.createApplication();
		MWindow window = BasicFactoryImpl.eINSTANCE.createWindow();
		application.getChildren().add(window);
		application.setSelectedElement(window);
		MArea area = AdvancedFactoryImpl.eINSTANCE.createArea();
		window.getSharedElements().add(area);
		MPart sharedPart = BasicFactoryImpl.eINSTANCE.createPart();
		window.getSharedElements().add(sharedPart);
		area.getChildren().add(sharedPart);
		area.setSelectedElement(sharedPart);
		MPerspectiveStack perspectiveStack = AdvancedFactoryImpl.eINSTANCE
				.createPerspectiveStack();
		window.getChildren().add(perspectiveStack);
		window.setSelectedElement(perspectiveStack);
		MPerspective perspectiveA = AdvancedFactoryImpl.eINSTANCE
				.createPerspective();
		perspectiveStack.getChildren().add(perspectiveA);
		perspectiveStack.setSelectedElement(perspectiveA);
		MPlaceholder areaPlaceholderA = AdvancedFactoryImpl.eINSTANCE
				.createPlaceholder();
		areaPlaceholderA.setRef(area);
		area.setCurSharedRef(areaPlaceholderA);
		perspectiveA.getChildren().add(areaPlaceholderA);
		perspectiveA.setSelectedElement(areaPlaceholderA);
		MPartStack stackA = BasicFactoryImpl.eINSTANCE.createPartStack();
		perspectiveA.getChildren().add(stackA);
		MPart partA = BasicFactoryImpl.eINSTANCE.createPart();
		stackA.getChildren().add(partA);
		stackA.setSelectedElement(partA);
		MPerspective perspectiveB = AdvancedFactoryImpl.eINSTANCE