Bug 496379 - NPE when disposing Zest graph with connection inside a container
Summary: NPE when disposing Zest graph with connection inside a container
Status: NEW
Alias: None
Product: GEF
Classification: Tools
Component: GEF-Legacy Zest (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 10
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: gef-inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-06-20 06:01 EDT by Daniel Gomez Esperon CLA
Modified: 2016-06-24 03:52 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Gomez Esperon CLA 2016-06-20 06:01:20 EDT
I am using Zest containers to visualize state graphs.
In my special case when the graph is disposed and all the widgets get disposed too, a NPE is thrown for each connection that is disposed.

A simple setup to reproduce is a (Zest)Graph, a GraphContainer widget in that graph, and inside that graph container two GraphNodes. A GraphConnection connects the nodes inside the same container.

The NPE:
When the disposing process reaches the GraphConnection, at some point org.eclipse.zest.core.widgets.GraphConnection.removeFigure() is called.
The connection as well as the source node and target node a members of the same container. therefore the fields connectionFigure, sourceContainerConnectionFigure and targetContainerConnectionFigure point to the same object.

The connectionFigure is removed from its parent, which leads to the NPE when trying to remove source- and targetContainerConnectionFigure from its now null parent.

Thanks for taking a look at it.