Bug 218148 - disposed widget is still in Graph.selectedItems
Summary: disposed widget is still in Graph.selectedItems
Status: RESOLVED FIXED
Alias: None
Product: GEF
Classification: Tools
Component: GEF-Legacy Zest (show other bugs)
Version: 3.3   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.6.0 (Helios) RC1   Edit
Assignee: Ian Bull CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 203420 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-02-07 05:44 EST by Michael Bauschert CLA
Modified: 2015-03-20 04:01 EDT (History)
4 users (show)

See Also:


Attachments
patch file based on Graph (cvs version 1.35) (792 bytes, patch)
2008-02-07 05:44 EST, Michael Bauschert CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Bauschert CLA 2008-02-07 05:44:16 EST
Created attachment 89119 [details]
patch file based on Graph (cvs version 1.35)

scenario:
a GraphNode is selected and is getting disposed.

During the disposal the GraphNode is not removed from the selectedItems-List within the Graph class.

If now a redraw happend there will be a SWTException:


org.eclipse.swt.SWTException: Widget is disposed
	at org.eclipse.swt.SWT.error(SWT.java:3374)
	at org.eclipse.swt.SWT.error(SWT.java:3297)
	at org.eclipse.swt.SWT.error(SWT.java:3268)
	at org.eclipse.swt.widgets.Widget.error(Widget.java:435)
	at org.eclipse.swt.widgets.Widget.checkWidget(Widget.java:330)
	at org.eclipse.swt.widgets.Widget.getStyle(Widget.java:601)
	at org.eclipse.mylyn.zest.core.widgets.GraphNode.getStyle(GraphNode.java:686)
	at org.eclipse.mylyn.zest.core.widgets.GraphItem.checkStyle(GraphItem.java:112)
	at org.eclipse.mylyn.zest.core.widgets.GraphNode.updateFigureForModel(GraphNode.java:774)
	at org.eclipse.mylyn.zest.core.widgets.GraphNode.unhighlight(GraphNode.java:488)
	at org.eclipse.mylyn.zest.core.widgets.Graph.clearSelection(Graph.java:702)
	at org.eclipse.mylyn.zest.core.widgets.Graph.access$3(Graph.java:697)
	at org.eclipse.mylyn.zest.core.widgets.Graph$DragSupport.mousePressed(Graph.java:636)
	at org.eclipse.draw2d.Figure.handleMousePressed(Figure.java:873)
Comment 1 Ian Bull CLA 2008-02-09 00:08:34 EST
Moving to Zest's new home in GEF.
Comment 2 Stefan Tucker CLA 2008-06-13 15:55:11 EDT
Duplicate of Bug 203420.
Comment 3 Ulli Hafner CLA 2010-05-05 04:46:53 EDT
Is something wrong with the patch? This bug still is present in 3.5.2 (i.e. zest 1.1.0).
Comment 4 Ian Bull CLA 2010-05-11 18:44:09 EDT
The patch doesn't apply anymore, but that's ok.  It's pretty straight forward. This bug just got missed, sorry about that.

I've released the fix for RC1.
Comment 5 Ian Bull CLA 2010-05-17 01:12:56 EDT
*** Bug 203420 has been marked as a duplicate of this bug. ***
Comment 6 Ulli Hafner CLA 2010-07-08 10:53:54 EDT
Thanks for fixing the bug. I tried the new release and the exception does not occur anymore.

However, I think that the fix is not complete yet. When the graph is used within a GraphViewer then the GraphViewer does not raise a SelectionChanged event if a  selected node has been deleted. It only sends selection change events on mouse selections. (I tried to manually set the selection on the GraphViewer but that does not work either, this seems to be another bug). 

Should I reopen this bug or is a new bug report more appropriate?
Comment 7 Alexander Nyßen CLA 2014-05-22 03:58:00 EDT
Comment on attachment 89119 [details]
patch file based on Graph (cvs version 1.35)

It seems this patch has been applied (with modifications), thus adding iplog flag.
Comment 8 Alexander Nyßen CLA 2015-03-20 04:01:40 EDT
Comment on attachment 89119 [details]
patch file based on Graph (cvs version 1.35)

Removing iplog+ flag again, due to Ian's comment #4.