Summary: | Graphic is disposed error in Ctrl+e editor dropdown | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | [Eclipse Project] Platform | Reporter: | Michael Van Meekeren <michaelvanmeekeren> | ||||||
Component: | UI | Assignee: | Platform-UI-Inbox <Platform-UI-Inbox> | ||||||
Status: | VERIFIED FIXED | QA Contact: | |||||||
Severity: | normal | ||||||||
Priority: | P2 | CC: | billy.biggs, n.a.edgar | ||||||
Version: | 3.0 | ||||||||
Target Milestone: | 3.0 RC4 | ||||||||
Hardware: | PC | ||||||||
OS: | Linux | ||||||||
Whiteboard: | |||||||||
Attachments: |
|
Description
Michael Van Meekeren
2004-06-21 12:11:27 EDT
billy please investigate We believe this is a problem in the SWT implementation of Table on motif. !ENTRY org.eclipse.ui 4 0 Jun 22, 2004 10:38:57.68 !MESSAGE Graphic is disposed !STACK 0 org.eclipse.swt.SWTException: Graphic is disposed at org.eclipse.swt.SWT.error(SWT.java:2691) at org.eclipse.swt.SWT.error(SWT.java:2616) at org.eclipse.swt.SWT.error(SWT.java:2587) at org.eclipse.swt.graphics.Image.getBounds(Image.java:738) at org.eclipse.swt.widgets.TableItem.drawImage(TableItem.java:213) at org.eclipse.swt.widgets.TableItem.paint(TableItem.java:1122) at org.eclipse.swt.widgets.Table.paintSubItem(Table.java:1936) at org.eclipse.swt.widgets.Table.paintItems(Table.java:1903) at org.eclipse.swt.widgets.Table.paint(Table.java:1834) at org.eclipse.swt.widgets.Table.handleEvents(Table.java:1437) at org.eclipse.swt.widgets.SelectableItemWidget$2.handleEvent(SelectableItemWidget.java:1199) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:82) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:731) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:752) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:738) at org.eclipse.swt.widgets.Composite.XExposure(Composite.java:882) at org.eclipse.swt.widgets.Widget.windowProc(Widget.java:906) at org.eclipse.swt.widgets.Display.windowProc(Display.java:3478) at org.eclipse.swt.internal.motif.OS.XtDispatchEvent(Native Method) at org.eclipse.swt.widgets.Control.update(Control.java:2855) at org.eclipse.swt.widgets.Control.update(Control.java:2840) at org.eclipse.swt.widgets.SelectableItemWidget.scroll(SelectableItemWidget.java:1580) at org.eclipse.swt.widgets.Table.scrollVerticalRemovedItem(Table.java:2390) at org.eclipse.swt.widgets.SelectableItemWidget.removingItem(SelectableItemWidget.java:1477) at org.eclipse.swt.widgets.Table.removeItem(Table.java:2209) at org.eclipse.swt.widgets.TableItem.dispose(TableItem.java:179) at org.eclipse.swt.widgets.Table.remove(Table.java:2069) at org.eclipse.jface.viewers.TableViewer.internalRefresh(TableViewer.java:497) at org.eclipse.jface.viewers.TableViewer.internalRefresh(TableViewer.java:449) at org.eclipse.jface.viewers.StructuredViewer$7.run(StructuredViewer.java:926) at org.eclipse.jface.viewers.StructuredViewer.preservingSelection(StructuredViewer.java:864) at org.eclipse.jface.viewers.StructuredViewer.refresh(StructuredViewer.java:924) at org.eclipse.jface.viewers.StructuredViewer.refresh(StructuredViewer.java:883) at org.eclipse.ui.internal.presentations.AbstractTableInformationControl.removeSelectedItems(AbstractTableInformationControl.java:321) at org.eclipse.ui.internal.presentations.AbstractTableInformationControl$1.keyPressed(AbstractTableInformationControl.java:221) at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:121) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:82) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:731) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:752) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:738) at org.eclipse.swt.widgets.Control.sendKeyEvent(Control.java:1794) at org.eclipse.swt.widgets.Control.XKeyPress(Control.java:3123) at org.eclipse.swt.widgets.Composite.XKeyPress(Composite.java:906) at org.eclipse.swt.widgets.Widget.windowProc(Widget.java:908) at org.eclipse.swt.widgets.Display.windowProc(Display.java:3478) at org.eclipse.swt.internal.motif.OS.XtDispatchEvent(Native Method) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2640) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1375) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1346) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:252) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:141) at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:96) at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:335) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:272) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:128) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.eclipse.core.launcher.Main.basicRun(Main.java:186) at org.eclipse.core.launcher.Main.run(Main.java:647) at org.eclipse.core.launcher.Main.main(Main.java:631) Graphic is disposed You disposed the image behind the back of the Table. On Windows (and elsewhere), you are feeding the operating system garbage, but it recovers. It is also possible that the native tables on the other platforms are not painting right away and the case does not happen. You need to dispose the image after the items have been disposed. Consult with Veronika before applying your fix just to be safe at this late date. Created attachment 12659 [details]
Workaround in jface
The table is dynamically created from the part tab list in
BasicStackContentProvider. Only after the tab is destroyed along with its icon
does the editor drop down get a chance to update. If a paint occurs, it could
try to reference the disposed icon.
This patch avoids this case by using setRedraw() around the code where we
remove items from the Table to try and avoid paints which occur due to the
scrolling. We only do this on Motif. This may be an acceptable workaround for
RC4.
Created attachment 12672 [details]
New patch which only modifies BasicStackList
This patch to org.eclipse.ui.workbench updates the previous patch by only using
the setRedraw() hack in BasicStackList. This workaround should be a lot safer
than the old one.
Patch released for 20040622-1600 verified by BB on MOTIF |