Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 62325 - Unhandled event loop exception: Graphic is disposed
Summary: Unhandled event loop exception: Graphic is disposed
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P1 critical (vote)
Target Milestone: 3.0 M9   Edit
Assignee: Stefan Xenos CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-05-14 14:06 EDT by Hanna Farah CLA
Modified: 2004-05-19 14:42 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Hanna Farah CLA 2004-05-14 14:06:06 EDT
1. Open a couple of Java or text editors in the same workbook
2. Drag one editor to create another workbook
3. Drag and drop the previous editor to the initial workbook
4. If you select the editor's tab, it will not be highlighted with the 
approriate color (highlighted using the inactive color which suggests that 
there is maybe another workbook that believes it still owns the editor)
5. Try to close the dropped editor, you will get an 
Unhandled event loop exception
Reason:
Graphic is disposed

Note that this does not happen with integration build 20040513 but it does when 
I synchronized my code on May 14, 2004.

Here is the stack trace :

Thread [main] (Suspended (exception SWTException))
	SWT.error(int, Throwable, String) line: 2691
	SWT.error(int, Throwable) line: 2614
	SWT.error(int) line: 2585
	Image.getBounds() line: 950
	CTabItem.preferredWidth(GC, boolean, boolean) line: 611
	CTabFolder.setItemSize() line: 2713
	CTabFolder.updateItems() line: 3399
	CTabFolder.setSelection(int) line: 2927
	PaneFolder.setSelection(int) line: 471
	DefaultEditorPresentation(DefaultPartPresentation).selectPart
(IPresentablePart) line: 856
	EditorStack(PartStack).refreshPresentationSelection() line: 799
	EditorStack(PartStack).setSelection(LayoutPart) line: 774
	EditorStack.setVisibleEditor(EditorPane) line: 161
	EditorAreaHelper.setVisibleEditor(IEditorReference, boolean) line: 326
	EditorManager.setVisibleEditor(IEditorReference, boolean) line: 1048
	WorkbenchPage.bringToTop(IWorkbenchPart) line: 586
	WorkbenchPage.activate(IWorkbenchPart) line: 454
	WorkbenchPage.closeEditor(IEditorPart, boolean) line: 988
	WorkbenchPage.closeEditor(IEditorReference, boolean) line: 932
	EditorPane.doHide() line: 97
	EditorStack(PartStack).close(IPresentablePart) line: 219
	EditorStack.close(IPresentablePart[]) line: 199
	PartStack$1.close(IPresentablePart[]) line: 72
	DefaultPartPresentation$1.closeButtonPressed(CTabItem) line: 104
	PaneFolder.notifyCloseListeners(CTabItem) line: 417
	PaneFolder$1.close(CTabFolderEvent) line: 123
	CTabFolder.onMouse(Event) line: 2001
	CTabFolder$1.handleEvent(Event) line: 292
	EventTable.sendEvent(Event) line: 82
	CTabFolder(Widget).sendEvent(Event) line: 796
	Display.runDeferredEvents() line: 2716
	Display.readAndDispatch() line: 2382
	Workbench.runEventLoop(Window$IExceptionHandler, Display) line: 1363
	Workbench.runUI() line: 1334
	Workbench.createAndRunWorkbench(Display, WorkbenchAdvisor) line: 253
	PlatformUI.createAndRunWorkbench(Display, WorkbenchAdvisor) line: 141
	IDEApplication.run(Object) line: 97
	PlatformActivator$1.run(Object) line: 283
	EclipseStarter.run(Object) line: 242
	EclipseStarter.run(String[], Runnable) line: 119
	NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not 
available [native method]
	NativeMethodAccessorImpl.invoke(Object, Object[]) line: 39
	DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 25
	Method.invoke(Object, Object[]) line: 324
	Main.basicRun(String[]) line: 184
	Main.run(String[]) line: 637
	Main.main(String[]) line: 621
Comment 1 Hanna Farah CLA 2004-05-14 18:37:27 EDT
I am re-assigning this bug to Stefan because he understands the changes that 
were made to minimize the differences between views and editors. This problem 
doesn't exist for views but it does for editors. I have researched this for a 
couple of hours, here is a description:
If we open several editors, we drag and drop one to create a new workbook then 
drag and drop it in the initial editor, closing it in the initial workbook will 
cause an exception, but, dragging and dropping it to create a new workbook 
again then closing it there will work correctly. This is the same case if we 
want to apply it to several editors, if we drag several editors and drop each 
one to create a new workbook, then we merge them all in the initial workbook, 
closing them will cause exceptions but dragging them out again to create a new 
workbook for each one (note that the order does not matter), and closing each 
one in its own workbook will work.
Comment 2 Stefan Xenos CLA 2004-05-15 04:46:31 EDT
Fixed in head. This was being caused by the workbook pointer in PartStack
getting out of date.

(Michael, you'll be relieved to know that I fixed this without doing any major
refactoring. Most of my changes were to helper methods for the test suites.)

I've updated the drag tests to check the internal state of PartStacks and
EditorPanes for consistency. 

I'm working on an additional patch to test tab rearrangement and verify
activation and focus state after drags.
Comment 3 Stefan Xenos CLA 2004-05-15 04:46:44 EDT
fixed
Comment 4 Hanna Farah CLA 2004-05-19 14:42:07 EDT
Verified for integration build I20040519, Wed, 19 May 2004 -- 00:10 (-0400)