Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 354158

Summary: [Table] "Widget is disposed" when closing UML model editor
Product: z_Archived Reporter: Nicolas Bros <nicolas.bros>
Component: EMF-FacetAssignee: Nicolas Bros <nicolas.bros>
Status: ASSIGNED --- QA Contact:
Severity: normal    
Priority: P5 CC: emft.facet-inbox, gdupe
Version: unspecifiedFlags: gdupe: indigo+
gdupe: iplog+
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Bug Depends on: 355218    
Bug Blocks:    
Attachments:
Description Flags
stacktraces gdupe: iplog-

Description Nicolas Bros CLA 2011-08-08 11:53:06 EDT
Created attachment 201089 [details]
stacktraces

- Open a UML model with the UML editor
- Select a Class and do "Edit in a table editor"
- Close the UML editor

This results in a "Widget is disposed" exception from SWT, a broken table editor, and other exceptions when you click on other views or editors in Eclipse (because of a NPE in NatTableWidget#usesTmpResource).

See attached stacktraces.
Comment 1 Nicolas Bros CLA 2011-08-19 09:29:42 EDT
The problem comes from the UMLEditor : when it is closed, it doesn't remove its listener on its CommandStack, which is shared with the NatTableWidget.
Then, when the NatTableWidget tries to execute a command on this CommandStack, the UMLEditor is notified and tries to update itself while disposed.
Comment 2 Nicolas Bros CLA 2011-08-25 05:30:22 EDT
I tested on my laptop today and I couldn't reproduce the bug. I'm wondering whether this could be a race-condition, or maybe another commit fixed this bug too.

I will test again on my main PC with the latest version.
Comment 3 Nicolas Bros CLA 2011-09-07 09:51:29 EDT
(In reply to comment #2)
> I will test again on my main PC with the latest version.

I have tested again, and the issue is still happening.

I have added a "known problems" section in the documentation with a workaround for this issue.
Comment 4 Nicolas Bros CLA 2011-10-03 10:40:13 EDT
Note: the issue also happened in EMF Facet unit tests. I had to modify the tests so that they close the table editor/view before the UML editor.