插件开发 系统关闭后报 swt.SWTException:Widget is disposed;

插件项目关闭后报这个错误。怎么解决啊。
是这个 "org.eclipse.core.commands" 没加载进来吗? 这个包我查了下 已经有了。

!ENTRY org.eclipse.core.commands 4 2 2017-11-23 14:43:02.263
!MESSAGE Problems occurred when invoking code from plug-in: "org.eclipse.core.commands".
!STACK 0
org.eclipse.swt.SWTException: Widget is disposed
at org.eclipse.swt.SWT.error(SWT.java:4533)
at org.eclipse.swt.SWT.error(SWT.java:4448)
at org.eclipse.swt.SWT.error(SWT.java:4419)
at org.eclipse.swt.widgets.Widget.error(Widget.java:482)
at org.eclipse.swt.widgets.Widget.checkWidget(Widget.java:354)
at org.eclipse.swt.widgets.Tree.getItems(Tree.java:3351)
at org.eclipse.ui.views.properties.PropertySheetViewer.findItem(PropertySheetViewer.java:443)
at org.eclipse.ui.views.properties.PropertySheetViewer.access$3(PropertySheetViewer.java:441)
at org.eclipse.ui.views.properties.PropertySheetViewer$3.valueChanged(PropertySheetViewer.java:342)
at org.eclipse.ui.views.properties.PropertySheetEntry.fireValueChanged(PropertySheetEntry.java:327)
at org.eclipse.ui.views.properties.PropertySheetEntry.setValues(PropertySheetEntry.java:731)
at org.eclipse.ui.views.properties.PropertySheetEntry.refreshValues(PropertySheetEntry.java:588)
at org.eclipse.ui.views.properties.PropertySheetEntry.refreshChildEntries(PropertySheetEntry.java:542)
at org.eclipse.ui.views.properties.PropertySheetEntry.refreshFromRoot(PropertySheetEntry.java:566)
at com.fiberhome.ason.platform.operation.UndoablePropertySheetEntry.historyNotification(UndoablePropertySheetEntry.java:39)
at org.eclipse.core.commands.operations.DefaultOperationHistory$2.run(DefaultOperationHistory.java:868)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.core.commands.operations.DefaultOperationHistory.notifyListeners(DefaultOperationHistory.java:857)
at org.eclipse.core.commands.operations.DefaultOperationHistory.notifyRemoved(DefaultOperationHistory.java:968)
at org.eclipse.core.commands.operations.DefaultOperationHistory.internalRemove(DefaultOperationHistory.java:832)
at org.eclipse.core.commands.operations.DefaultOperationHistory.flushUndo(DefaultOperationHistory.java:599)
at org.eclipse.core.commands.operations.DefaultOperationHistory.dispose(DefaultOperationHistory.java:313)
at org.eclipse.ui.internal.operations.WorkbenchOperationSupport.dispose(WorkbenchOperationSupport.java:58)
at org.eclipse.ui.internal.WorkbenchPlugin.reset(WorkbenchPlugin.java:257)
at org.eclipse.ui.internal.Workbench.shutdown(Workbench.java:3061)
at org.eclipse.ui.internal.Workbench.busyClose(Workbench.java:1174)
at org.eclipse.ui.internal.Workbench.lambda$4(Workbench.java:1424)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
at org.eclipse.ui.internal.Workbench.close(Workbench.java:1424)
at org.eclipse.ui.internal.Workbench.close(Workbench.java:1397)
at org.eclipse.ui.internal.WorkbenchWindow.busyClose(WorkbenchWindow.java:1606)
at org.eclipse.ui.internal.WorkbenchWindow.access$18(WorkbenchWindow.java:1552)
at org.eclipse.ui.internal.WorkbenchWindow$11.run(WorkbenchWindow.java:1638)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
at org.eclipse.ui.internal.WorkbenchWindow.close(WorkbenchWindow.java:1635)
at org.eclipse.ui.internal.WorkbenchWindow.close(WorkbenchWindow.java:1649)
at org.eclipse.ui.internal.WorkbenchWindow$6.close(WorkbenchWindow.java:530)
at org.eclipse.e4.ui.workbench.renderers.swt.WBWRenderer$3.shellClosed(WBWRenderer.java:615)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:99)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:86)
at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4428)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1079)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1103)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1088)
at org.eclipse.swt.widgets.Decorations.closeWidget(Decorations.java:316)
at org.eclipse.swt.widgets.Decorations.WM_CLOSE(Decorations.java:1729)
at org.eclipse.swt.widgets.Control.windowProc(Control.java:4845)
at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:359)
at org.eclipse.swt.widgets.Decorations.windowProc(Decorations.java:1657)
at org.eclipse.swt.widgets.Shell.windowProc(Shell.java:2199)
at org.eclipse.swt.widgets.Display.windowProc(Display.java:5178)
at org.eclipse.swt.internal.win32.OS.DefWindowProcW(Native Method)
at org.eclipse.swt.internal.win32.OS.DefWindowProc(OS.java:2555)
at org.eclipse.swt.widgets.Shell.callWindowProc(Shell.java:506)
at org.eclipse.swt.widgets.Control.windowProc(Control.java:4941)
at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:359)
at org.eclipse.swt.widgets.Decorations.windowProc(Decorations.java:1657)
at org.eclipse.swt.widgets.Shell.windowProc(Shell.java:2199)
at org.eclipse.swt.widgets.Display.windowProc(Display.java:5178)
at org.eclipse.swt.internal.win32.OS.DefWindowProcW(Native Method)
at org.eclipse.swt.internal.win32.OS.DefWindowProc(OS.java:2555)
at org.eclipse.swt.widgets.Shell.callWindowProc(Shell.java:506)
at org.eclipse.swt.widgets.Control.windowProc(Control.java:4941)
at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:359)
at org.eclipse.swt.widgets.Decorations.windowProc(Decorations.java:1657)
at org.eclipse.swt.widgets.Shell.windowProc(Shell.java:2199)
at org.eclipse.swt.widgets.Display.windowProc(Display.java:5178)
at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method)
at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:2560)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3815)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1150)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1039)
at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:153)
at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:680)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:594)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:148)
at com.fiberhome.ason.platform.runtime.PlannerApplication.start(PlannerApplication.java:29)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:388)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:243)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:653)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:590)
at org.eclipse.equinox.launcher.Main.run(Main.java:1499)
at org.eclipse.equinox.launcher.Main.main(Main.java:1472)

1个回答

Widget is disposed,这个是说控件已被销毁。
看堆栈应该是工作区的属性控件中的树控件被销毁了,检测自己的插件是否应用了此控件,并对其销毁。

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问