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
IEclipseContext perspectiveContextA = perspectiveA.getContext();
		assertEquals(perspectiveContextA, windowContext.getActiveChild());
		window.getContext().get(EPartService.class)
				.switchPerspective(perspectiveB);
		IEclipseContext perspectiveContextB = perspectiveB.getContext();
		assertEquals(perspectiveContextB, windowContext.getActiveChild());
	}
	public void testSwitchPerspective02() {
		MApplication application = ApplicationFactoryImpl.eINSTANCE
				.createApplication();
		MWindow windowA = BasicFactoryImpl.eINSTANCE.createWindow();
		application.getChildren().add(windowA);
		application.setSelectedElement(windowA);
		MPerspectiveStack perspectiveStackA = AdvancedFactoryImpl.eINSTANCE
				.createPerspectiveStack();
		windowA.getChildren().add(perspectiveStackA);
		windowA.setSelectedElement(perspectiveStackA);
		MPerspective perspectiveA1 = AdvancedFactoryImpl.eINSTANCE
				.createPerspective();
		perspectiveStackA.getChildren().add(perspectiveA1);
		perspectiveStackA.setSelectedElement(perspectiveA1);
		MPerspective perspectiveA2 = AdvancedFactoryImpl.eINSTANCE
				.createPerspective();
		perspectiveStackA.getChildren().add(perspectiveA2);
		MWindow windowB = BasicFactoryImpl.eINSTANCE.createWindow();
		application.getChildren().add(windowB);
		MPerspectiveStack perspectiveStackB = AdvancedFactoryImpl.eINSTANCE
				.createPerspectiveStack();
		windowB.getChildren().add(perspectiveStackB);
		windowB.setSelectedElement(perspectiveStackB);