Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Widget is disposed exception when closing automatically opened diagram in Capella #46

Open
Kellindil opened this issue Dec 14, 2023 · 4 comments

Comments

@Kellindil
Copy link

Kellindil commented Dec 14, 2023

  • Download Capella 6.1 (or 7.0)
  • Start on new workspace
  • Create a new project
  • Create a new diagram (e.g. PAB)
  • Ensure properties view is shown
  • Close Capella with this diagram open, do not save when prompted
  • Restart Capella

The diagram is automatically opened with a message saying "This diagram was not saved. You can close the editor".

  • Close the editor

One of the following exceptions is thrown:

org.eclipse.swt.SWTException: Widget is disposed
    at org.eclipse.swt.SWT.error(SWT.java:4893)
    at org.eclipse.swt.SWT.error(SWT.java:4808)
    at org.eclipse.swt.SWT.error(SWT.java:4779)
    at org.eclipse.swt.widgets.Widget.error(Widget.java:438)
    at org.eclipse.swt.widgets.Widget.checkWidget(Widget.java:357)
    at org.eclipse.swt.widgets.Button.getImage(Button.java:590)
    at org.eclipse.gmf.runtime.diagram.ui.properties.sections.grid.RulerGridPropertySection.dispose(RulerGridPropertySection.java:687)
    at org.eclipse.ui.views.properties.tabbed.TabContents$2.run(TabContents.java:130)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
    at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:174)
    at org.eclipse.ui.views.properties.tabbed.TabContents.dispose(TabContents.java:133)
    at org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage.disposeTabs(TabbedPropertySheetPage.java:623)
    at org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage.disposeContributor(TabbedPropertySheetPage.java:468)
    at org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage.dispose(TabbedPropertySheetPage.java:491)
    at org.eclipse.gmf.runtime.diagram.ui.properties.views.PropertiesBrowserPage.dispose(PropertiesBrowserPage.java:164)

or

org.eclipse.swt.SWTException: Widget is disposed
    at org.eclipse.swt.SWT.error(SWT.java:4893)
    at org.eclipse.swt.SWT.error(SWT.java:4808)
    at org.eclipse.swt.SWT.error(SWT.java:4779)
    at org.eclipse.swt.widgets.Widget.error(Widget.java:438)
    at org.eclipse.swt.widgets.Widget.checkWidget(Widget.java:357)
    at org.eclipse.swt.widgets.Button.getImage(Button.java:590)
    at org.eclipse.gmf.runtime.diagram.ui.properties.sections.grid.RulerGridPropertySection.dispose(RulerGridPropertySection.java:687)
    at org.eclipse.eef.properties.ui.legacy.internal.legacy2eef.EEFLegacySection.dispose(EEFLegacySection.java:71)
    at org.eclipse.eef.properties.ui.api.EEFTabContents$6.run(EEFTabContents.java:207)
@pcdavid
Copy link
Contributor

pcdavid commented Dec 14, 2023

Download Capella 6.1 (or 7.0)

For reference, Capella 6.1 uses GMF Runtime 1.15.3.

@pcdavid
Copy link
Contributor

pcdavid commented Dec 14, 2023

It seems to be caused by c453d15.

@pcdavid
Copy link
Contributor

pcdavid commented Dec 14, 2023

Testing if (lineColorButton != null) is not enough, we probably need to add if (lineColorButton != null && !lineColorButton.isDisposed()) {.

@pcdavid pcdavid added this to the 1.16.3 milestone Dec 18, 2023
@pcdavid
Copy link
Contributor

pcdavid commented Dec 18, 2023

I see other similar exception on related (but different) scenarios:

java.lang.Error: SWT Resource was not properly disposed
	at org.eclipse.swt.graphics.Resource.initNonDisposeTracking(Resource.java:172)
	at org.eclipse.swt.graphics.Resource.<init>(Resource.java:120)
	at org.eclipse.swt.graphics.Image.<init>(Image.java:655)
	at org.eclipse.jface.resource.ImageDescriptor.createImage(ImageDescriptor.java:341)
	at org.eclipse.jface.resource.ImageDescriptor.createImage(ImageDescriptor.java:290)
	at org.eclipse.jface.resource.ImageDescriptor.createImage(ImageDescriptor.java:268)
	at org.eclipse.gmf.runtime.diagram.ui.properties.sections.appearance.ColorsAndFontsPropertySection.refresh(ColorsAndFontsPropertySection.java:577)
	at org.eclipse.gmf.runtime.diagram.ui.properties.sections.appearance.ColoursAndFontsAndLineStylesPropertySection.refresh(ColoursAndFontsAndLineStylesPropertySection.java:312)
	at org.eclipse.gmf.runtime.diagram.ui.properties.sections.appearance.ShapeColorsAndFontsPropertySection.refresh(ShapeColorsAndFontsPropertySection.java:96)
java.lang.Error: SWT Resource was not properly disposed
	at org.eclipse.swt.graphics.Resource.initNonDisposeTracking(Resource.java:172)
	at org.eclipse.swt.graphics.Resource.<init>(Resource.java:120)
	at org.eclipse.swt.graphics.Image.<init>(Image.java:655)
	at org.eclipse.jface.resource.ImageDescriptor.createImage(ImageDescriptor.java:341)
	at org.eclipse.jface.resource.ImageDescriptor.createImage(ImageDescriptor.java:290)
	at org.eclipse.jface.resource.ImageDescriptor.createImage(ImageDescriptor.java:268)
	at org.eclipse.gmf.runtime.diagram.ui.properties.sections.appearance.ShapeColorsAndFontsPropertySection.refresh(ShapeColorsAndFontsPropertySection.java:100)
	at org.eclipse.ui.views.properties.tabbed.TabContents$6.run(TabContents.java:220)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:47)
	at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:174)
	at org.eclipse.ui.views.properties.tabbed.TabContents.refresh(TabContents.java:223)
	at org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage.handlePartActivated(TabbedPropertySheetPage.java:349)
	at org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage$1.partActivated(TabbedPropertySheetPage.java:121)
java.lang.Error: SWT Resource was not properly disposed
	at org.eclipse.swt.graphics.Resource.initNonDisposeTracking(Resource.java:172)
	at org.eclipse.swt.graphics.Resource.<init>(Resource.java:120)
	at org.eclipse.swt.graphics.Image.<init>(Image.java:655)
	at org.eclipse.jface.resource.ImageDescriptor.createImage(ImageDescriptor.java:341)
	at org.eclipse.jface.resource.ImageDescriptor.createImage(ImageDescriptor.java:290)
	at org.eclipse.jface.resource.ImageDescriptor.createImage(ImageDescriptor.java:268)
	at org.eclipse.gmf.runtime.diagram.ui.properties.sections.appearance.ColorsAndFontsPropertySection.refresh(ColorsAndFontsPropertySection.java:571)
	at org.eclipse.gmf.runtime.diagram.ui.properties.sections.appearance.ColoursAndFontsAndLineStylesPropertySection.refresh(ColoursAndFontsAndLineStylesPropertySection.java:312)
	at org.eclipse.gmf.runtime.diagram.ui.properties.sections.appearance.ShapeColorsAndFontsPropertySection.refresh(ShapeColorsAndFontsPropertySection.java:96)
	at org.eclipse.ui.views.properties.tabbed.TabContents$6.run(TabContents.java:220)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:47)
	at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:174)
	at org.eclipse.ui.views.properties.tabbed.TabContents.refresh(TabContents.java:223)
	at org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage.handlePartActivated(TabbedPropertySheetPage.java:349)
	at org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage$1.partActivated(TabbedPropertySheetPage.java:121)

@pcdavid pcdavid modified the milestones: 1.16.3, 1.16.4 Mar 29, 2024
@pcdavid pcdavid removed this from the 1.16.4 milestone Oct 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants