Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 244387
Collapse All | Expand All

(-)src/org/eclipse/zest/core/viewers/internal/AbstractStructuredGraphViewer.java (-1 / +2 lines)
Lines 644-650 Link Here
644
	 *            The node element to remove.
643
	 *            The node element to remove.
645
	 */
644
	 */
646
	public void removeNode(Object element) {
645
	public void removeNode(Object element) {
647
		GraphNode node = (GraphNode) nodesMap.get(element);
646
		// remove the node from the nodes map to prevent memory leak
647
		GraphNode node = (GraphNode) nodesMap.remove(element);
648
648
649
		if (node != null) {
649
		if (node != null) {
650
			// remove the node from the layout algorithm and all the connections
650
			// remove the node from the layout algorithm and all the connections
(-)src/org/eclipse/zest/core/viewers/internal/AbstractStylingModelFactory.java (+1 lines)
Lines 295-300 Link Here
295
	 */
294
	 */
296
	public void clearGraph(Graph graph) {
295
	public void clearGraph(Graph graph) {
297
		graph.setSelection(null);
296
		graph.setSelection(null);
297
		graph.clear();
298
		Object[] nodeElements = viewer.getNodeElements();
298
		Object[] nodeElements = viewer.getNodeElements();
299
		for (int i = 0; i < nodeElements.length; i++) {
299
		for (int i = 0; i < nodeElements.length; i++) {
300
			viewer.removeGraphModelNode(nodeElements[i]);
300
			viewer.removeGraphModelNode(nodeElements[i]);
(-)src/org/eclipse/zest/core/widgets/Graph.java (+4 lines)
Lines 1169-1172 Link Here
1169
		return (GraphItem) figure2ItemMap.get(figure);
1176
		return (GraphItem) figure2ItemMap.get(figure);
1170
	}
1177
	}
1171
1178
1179
	public void clear() {
1180
		figure2ItemMap.clear();
1181
	}
1182
1172
}
1183
}

Return to bug 244387