Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » EMF Forms Widget Disposed Exception(I get Widget Disposed Exception when using a ECPSWTViewRenderer.INSTANCE.render(...);)
EMF Forms Widget Disposed Exception [message #1782227] Tue, 20 February 2018 18:44 Go to next message
Pierre Allard is currently offline Pierre AllardFriend
Messages: 6
Registered: February 2016
Junior Member
I am using EMFForms to get a composite populated with the details of an EObject selected in another widget, The basic sequence is the following:

1. In widgetA, an EObject (EObject1) is selected.
2. Widget widgetB, which contains the EMFForm generate details, receives the selection.
3. The controls in widgetB are disposed.
4. A VView (viewModel) is created for eObject1;
5. ECPSWTViewRenderer.INSTANCE.render(widgetB, eObject1, viewModel) is called.
6. Up to that point, all is good.
7. A new eObject (eObject2) is selected in widgetA.
8. Steps 2 to 5 are repeated for eObject2.
9 . At that point, an attribute changes in eObject1 (which no longer displayed) starte chnaging periodically (it is driven from a Job) . I then start to continuously get :

org.eclipse.swt.SWTException: Failed to execute runnable (org.eclipse.swt.SWTException: Widget is disposed)
at org.eclipse.swt.SWT.error(
at org.eclipse.swt.SWT.error(
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(
at org.eclipse.swt.widgets.Display.runAsyncMessages(
at org.eclipse.swt.widgets.Display.readAndDispatch(
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$
at org.eclipse.core.databinding.observable.Realm.runWithDefault(
at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(
at org.eclipse.ui.internal.Workbench$
at org.eclipse.core.databinding.observable.Realm.runWithDefault(
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(
at ca.gc.asc_csa.apogy.rcp.Application.start(
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(
at sun.reflect.DelegatingMethodAccessorImpl.invoke(
at java.lang.reflect.Method.invoke(
at org.eclipse.equinox.launcher.Main.invokeFramework(
at org.eclipse.equinox.launcher.Main.basicRun(
at org.eclipse.equinox.launcher.Main.main(
Caused by: org.eclipse.swt.SWTException: Widget is disposed
at org.eclipse.swt.SWT.error(
at org.eclipse.swt.SWT.error(
at org.eclipse.swt.SWT.error(
at org.eclipse.swt.widgets.Widget.error(
at org.eclipse.swt.widgets.Widget.checkWidget(
at org.eclipse.swt.widgets.Composite.layout(
at org.eclipse.emf.ecp.view.internal.core.swt.renderer.LinkControlSWTRenderer$9$
at org.eclipse.ui.internal.UILockListener.doPendingWork(
at org.eclipse.ui.internal.UISynchronizer$
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(
... 24 more

I believe the problem is the dispose done in step 3. It seems that the listeners that are created by EMFForms are not unregistered and keep trying to update the widgets.

What is the correct way of disposing of an EMFForm generated composite content to prevent this from happening ?

Thanks !
Re: EMF Forms Widget Disposed Exception [message #1782447 is a reply to message #1782227] Fri, 23 February 2018 14:49 Go to previous message
Jonas Helming is currently offline Jonas HelmingFriend
Messages: 109
Registered: September 2016
Senior Member

you need to dispose the ECPSWTView, which is returned from the render call, i.e.
Please note that if the detail pane shows objects of the same type, you can also just replace the input instead of re-rendering everything (see

Best regards,


Get professional Eclipse developer support:

Jonas Helming
Get professional Eclipse developer support:
Previous Topic:Generated *FactoryImpl is not an instance of Resource.Factory
Next Topic:Model as a Backend?
Goto Forum:

Current Time: Sat May 21 03:20:58 GMT 2022

Powered by FUDForum. Page generated in 0.02191 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top