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
MPart partC = BasicFactoryImpl.eINSTANCE.createPart();
		window.getSharedElements().add(partC);
		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 placeholderC1 = AdvancedFactoryImpl.eINSTANCE
				.createPlaceholder();
		placeholderC1.setRef(partC);
		partC.setCurSharedRef(placeholderC1);
		perspectiveA.getChildren().add(placeholderC1);
		perspectiveA.setSelectedElement(placeholderC1);
		
		MPerspective perspectiveB = AdvancedFactoryImpl.eINSTANCE
				.createPerspective();
		perspectiveStack.getChildren().add(perspectiveB);
		MPlaceholder placeholderA2 = AdvancedFactoryImpl.eINSTANCE
				.createPlaceholder();
		placeholderA2.setRef(partA);
		partA.setCurSharedRef(placeholderA2);
		perspectiveB.getChildren().add(placeholderA2);
		perspectiveB.setSelectedElement(placeholderA2);
		MPlaceholder placeholderB2 = AdvancedFactoryImpl.eINSTANCE
				.createPlaceholder();
		placeholderB2.setRef(partB);