Skip to content

Ghidra is a software reverse engineering (SRE) framework

GP-492 fixing stack trace when re-using a graph display and the new graph excees the vertex limit

ghidravorebdd9868482bb
diff --git a/Ghidra/Features/GraphServices/src/main/java/ghidra/graph/visualization/DefaultGraphDisplay.java b/Ghidra/Features/GraphServices/src/main/java/ghidra/graph/visualization/DefaultGraphDisplay.java
index 2ec196e242..1b8c4134b1 100644
--- a/Ghidra/Features/GraphServices/src/main/java/ghidra/graph/visualization/DefaultGraphDisplay.java
+++ b/Ghidra/Features/GraphServices/src/main/java/ghidra/graph/visualization/DefaultGraphDisplay.java
@@ -429,7 +429,7 @@ public class DefaultGraphDisplay implements GraphDisplay {
.popupMenuGroup("z", "5")
.keyBinding("escape")
.enabledWhen(c -> hasSelection())
- .onAction(c -> clearSelection())
+ .onAction(c -> clearSelection(true))
.buildAndInstallLocal(componentProvider);
new ActionBuilder("Create Subgraph", ACTION_OWNER)
@@ -451,9 +451,9 @@ public class DefaultGraphDisplay implements GraphDisplay {
}
- private void clearSelection() {
- viewer.getSelectedVertexState().clear();
- viewer.getSelectedEdgeState().clear();
+ private void clearSelection(boolean fireEvents) {
+ viewer.getSelectedVertexState().clear(fireEvents);
+ viewer.getSelectedEdgeState().clear(fireEvents);
}
private boolean hasSelection() {
@@ -763,6 +763,8 @@ public class DefaultGraphDisplay implements GraphDisplay {
* @param attributedGraph the {@link AttributedGraph} to visualize
*/
private void doSetGraphData(AttributedGraph attributedGraph) {
+ clearSelection(false);
+ focusedVertex = null;
graph = attributedGraph;
layoutTransitionManager.setEdgeComparator(new EdgeComparator(graph, "EdgeType",