mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-03 01:39:21 +02:00
fixed stack trace when exporting
This commit is contained in:
parent
4300bec382
commit
1259632113
5 changed files with 24 additions and 5 deletions
|
@ -222,7 +222,8 @@ public abstract class AddressBasedGraphDisplayListener
|
|||
graphDisplay.updateVertexName(vertex, displayName);
|
||||
}
|
||||
|
||||
private void dispose() {
|
||||
@Override
|
||||
public void dispose() {
|
||||
Swing.runLater(() -> tool.removeListenerForAllPluginEvents(this));
|
||||
program.removeListener(this);
|
||||
}
|
||||
|
|
|
@ -39,6 +39,7 @@ class ExportAttributedGraphDisplay implements GraphDisplay {
|
|||
|
||||
private final PluginTool pluginTool;
|
||||
private String title;
|
||||
private AttributedGraph graph;
|
||||
|
||||
/**
|
||||
* Create the initial display, the graph-less visualization viewer, and its controls
|
||||
|
@ -55,7 +56,8 @@ class ExportAttributedGraphDisplay implements GraphDisplay {
|
|||
|
||||
@Override
|
||||
public void setGraphDisplayListener(GraphDisplayListener listener) {
|
||||
// This display is not interactive, so N/A
|
||||
// This display is not interactive, so just dispose the listener
|
||||
listener.dispose();
|
||||
}
|
||||
|
||||
|
||||
|
@ -86,10 +88,11 @@ class ExportAttributedGraphDisplay implements GraphDisplay {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void setGraph(AttributedGraph graphData, String title, boolean append,
|
||||
public void setGraph(AttributedGraph graph, String title, boolean append,
|
||||
TaskMonitor monitor) {
|
||||
this.title = title;
|
||||
doSetGraphData(graphData);
|
||||
this.graph = graph;
|
||||
doSetGraphData(graph);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -132,7 +135,7 @@ class ExportAttributedGraphDisplay implements GraphDisplay {
|
|||
|
||||
@Override
|
||||
public AttributedGraph getGraph() {
|
||||
return null;
|
||||
return graph;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -39,4 +39,9 @@ public class DummyGraphDisplayListener implements GraphDisplayListener {
|
|||
// I'm a dummy
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dispose() {
|
||||
// I'm a dummy
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -49,4 +49,9 @@ public interface GraphDisplayListener {
|
|||
*/
|
||||
public GraphDisplayListener cloneWith(GraphDisplay graphDisplay);
|
||||
|
||||
/**
|
||||
* Tells the listener that it is no longer needed and it can release any listeners/resources
|
||||
*/
|
||||
public void dispose();
|
||||
|
||||
}
|
||||
|
|
|
@ -303,6 +303,11 @@ public class GraphActionTest extends AbstractGhidraHeadedIntegrationTest {
|
|||
return new TestGraphDisplayListener("clone");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dispose() {
|
||||
// do nothing
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private AttributedGraph createGraph() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue