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
assertEquals(perspectiveA2.getContext(), windowA.getContext()
				.getActiveChild());
		assertEquals(perspectiveB1.getContext(), windowB.getContext()
				.getActiveChild());
		windowPartServiceB.switchPerspective(perspectiveB2);
		assertEquals(windowA.getContext(), application.getContext()
				.getActiveChild());
		assertEquals(perspectiveA2.getContext(), windowA.getContext()
				.getActiveChild());
		assertEquals(perspectiveB2.getContext(), windowB.getContext()
				.getActiveChild());
	}
	public void testSwitchPerspective03() {
		MApplication application = ApplicationFactoryImpl.eINSTANCE
				.createApplication();
		MWindow windowA = BasicFactoryImpl.eINSTANCE.createWindow();
		application.getChildren().add(windowA);
		application.setSelectedElement(windowA);
		MWindow windowB = BasicFactoryImpl.eINSTANCE.createWindow();
		application.getChildren().add(windowB);
		MPerspectiveStack perspectiveStackB = AdvancedFactoryImpl.eINSTANCE
				.createPerspectiveStack();
		windowB.getChildren().add(perspectiveStackB);
		windowB.setSelectedElement(perspectiveStackB);
		MPerspective perspectiveB1 = AdvancedFactoryImpl.eINSTANCE
				.createPerspective();
		perspectiveStackB.getChildren().add(perspectiveB1);
		perspectiveStackB.setSelectedElement(perspectiveB1);
		MPart partB1 = BasicFactoryImpl.eINSTANCE.createPart();
		perspectiveB1.getChildren().add(partB1);