Bug 295277 Part context is disposed twice when tab item is closed
Thread [main] (Suspended (breakpoint at line 305 in EclipseContext)) EclipseContext.dispose() line: 305 ContributedPartRenderer$2.widgetDisposed(DisposeEvent) line: 129 TypedListener.handleEvent(Event) line: 117 EventTable.sendEvent(Event) line: 84 Composite(Widget).sendEvent(Event) line: 1002 Composite(Widget).sendEvent(int, Event, boolean) line: 1026 Composite(Widget).sendEvent(int) line: 1007 Composite(Widget).release(boolean) line: 803 Composite(Widget).dispose() line: 441 ContributedPartRenderer(SWTPartRenderer).disposeWidget(MUIElement) line: 95 PartRenderingEngine.removeGui(MUIElement) line: 306 PartRenderingEngine$1.handleEvent(Event) line: 83 UIEventHandler$1.run() line: 42 Synchronizer.syncExec(Runnable) line: 179 Display.syncExec(Runnable) line: 4364 UIEventHandler.handleEvent(Event) line: 40 EventHandlerWrapper.handleEvent(Event, Permission) line: 177 EventHandlerTracker.dispatchEvent(Object, Object, int, Object) line: 198 EventManager.dispatchEvent(Set, EventDispatcher, int, Object) line: 227 ListenerQueue.dispatchEventSynchronous(int, Object) line: 149 EventAdminImpl.dispatchEvent(Event, boolean) line: 139 EventAdminImpl.sendEvent(Event) line: 78 EventComponent.sendEvent(Event) line: 39 EventBroker.send(String, Object) line: 67 UIEventPublisher.notifyChanged(Notification) line: 69 PartImpl(BasicNotifierImpl).eNotify(Notification) line: 280 PartImpl.setVisible(boolean) line: 394 StackRenderer$8.close(CTabFolderEvent) line: 447 ETabFolder(CTabFolder).onMouse(Event) line: 2189 CTabFolder$1.handleEvent(Event) line: 317 EventTable.sendEvent(Event) line: 84 ETabFolder(Widget).sendEvent(Event) line: 1002 Display.runDeferredEvents() line: 3917 Display.readAndDispatch() line: 3510 PartRenderingEngine$4.run() line: 422 Realm.runWithDefault(Realm, Runnable) line: 332 PartRenderingEngine.run(MApplicationElement, IEclipseContext) line: 369 Thread [main] (Suspended (breakpoint at line 305 in EclipseContext)) EclipseContext.dispose() line: 305 PartRenderingEngine.removeGui(MUIElement) line: 316 PartRenderingEngine$1.handleEvent(Event) line: 83 UIEventHandler$1.run() line: 42 Synchronizer.syncExec(Runnable) line: 179 Display.syncExec(Runnable) line: 4364 UIEventHandler.handleEvent(Event) line: 40 EventHandlerWrapper.handleEvent(Event, Permission) line: 177 EventHandlerTracker.dispatchEvent(Object, Object, int, Object) line: 198 EventManager.dispatchEvent(Set, EventDispatcher, int, Object) line: 227 ListenerQueue.dispatchEventSynchronous(int, Object) line: 149 EventAdminImpl.dispatchEvent(Event, boolean) line: 139 EventAdminImpl.sendEvent(Event) line: 78 EventComponent.sendEvent(Event) line: 39 EventBroker.send(String, Object) line: 67 UIEventPublisher.notifyChanged(Notification) line: 69 PartImpl(BasicNotifierImpl).eNotify(Notification) line: 280 PartImpl.setVisible(boolean) line: 394 StackRenderer$8.close(CTabFolderEvent) line: 447 ETabFolder(CTabFolder).onMouse(Event) line: 2189 CTabFolder$1.handleEvent(Event) line: 317 EventTable.sendEvent(Event) line: 84 ETabFolder(Widget).sendEvent(Event) line: 1002 Display.runDeferredEvents() line: 3917 Display.readAndDispatch() line: 3510 PartRenderingEngine$4.run() line: 422 Realm.runWithDefault(Realm, Runnable) line: 332 PartRenderingEngine.run(MApplicationElement, IEclipseContext) line: 369
bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/workbench/ui/renderers/swt/ContributedPartRenderer.java
public Object createWidget(final MUIElement element, Object parent) {
		if (!(element instanceof MPart) || !(parent instanceof Composite))
			return null;
		Widget parentWidget = (Widget) parent;
		IEclipseContext parentContext = getContextForParent(element);
		Widget newWidget = null;
		final Composite newComposite = new Composite((Composite) parentWidget,
				SWT.NONE);
		newComposite.setLayout(new FillLayout());
		newWidget = newComposite;
		bindWidget(element, newWidget);
		final MPart part = (MPart) element;
		
		IEclipseContext localContext = Workbench.initializeContext(
				parentContext, part);
		Workbench.processHierarchy(part);
		localContext.set(Composite.class.getName(), newComposite);
		localContext.set(MPart.class.getName(), part);
		parentContext.set(IContextConstants.ACTIVE_CHILD, localContext);
		IContributionFactory contributionFactory = (IContributionFactory) localContext
				.get(IContributionFactory.class.getName());
		Object newPart = contributionFactory
				.create(part.getURI(), localContext);
		part.setObject(newPart);
		final IEclipseContext eventLclContext = localContext;