Bug 318363 [UI] Closing Perspectives changes others
If you open the Debug perspective and then close it the Package Explorer disappears. Root cause was that I opened the second perspective using the perspective switcher which performed the operation 'locally' rather than going through the WorkbenchPage#setPerspective code. This meant that the 'openPerspectives' list wasn't updated which meant that the 'closePerspective' call delegated to 'closeAllPerspectives' since it thought there was only one open.
bundles/org.eclipse.e4.ui.workbench.addons.swt/src/org/eclipse/e4/ui/workbench/addons/perspectiveswitcher/PerspectiveSwitcher.java
MPerspective persp = (MPerspective) items[i].getData();
			if (persp != null)
				if (showText) {
					if (persp.getLabel() != null)
						items[i].setText(persp.getLabel());
					items[i].setToolTipText(persp.getTooltip());
				} else {
					Image image = items[i].getImage();
					if (image != null) {
						items[i].setText("");
						items[i].setToolTipText(persp.getLabel());
					}
				}
		}
		
		psTB.pack();
		psTB.getShell().layout(new Control[] { psTB }, SWT.DEFER);
	}
	private void addItem(final Menu menu, final String label) {
		MenuItem menuItem = new MenuItem(menu, SWT.NONE);
		menuItem.setText(label);
		menuItem.addSelectionListener(new SelectionAdapter() {
			public void widgetSelected(SelectionEvent e) {
				MPerspective persp = (MPerspective) menu.getData();
				E4Util.unsupported(label + " " + persp.getLabel());
			}
		});
	}
	private void removePerspectiveItem(MPerspective toRemove) {
		ToolItem psItem = getItemFor(toRemove);