Skip to content

Commit

Permalink
#91 invalidate cache on server start (#92)
Browse files Browse the repository at this point in the history
  • Loading branch information
unknown321 authored Mar 1, 2024
1 parent 79c2376 commit b228dd9
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions decompilers/d2d_ghidra/src/main/java/decomp2dbg/D2DPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,18 @@ public void actionPerformed(ActionContext context) {
configureD2DAction.setKeyBindingData(new KeyBindingData(KeyStroke.getKeyStroke('D', Event.CTRL_MASK + Event.SHIFT_MASK)));
return configureD2DAction;
}

private void clearCache() {
this.decompileCache.clear();
this.gVarCache.clear();
this.funcSymCache.clear();
this.funcDataCache.clear();
this.structCache.clear();
this.typeAliasCache.clear();
this.unionCache.clear();
this.enumCache.clear();
this.elfInfoCache.clear();
}

private void configureD2DServer() {
Msg.info(this, "Configuring decomp2dbg...");
Expand All @@ -125,7 +137,7 @@ private void configureD2DServer() {
}
} else
return;

this.server = new D2DGhidraServer(host, port, this);

try {
Expand All @@ -134,7 +146,9 @@ private void configureD2DServer() {
JOptionPane.showMessageDialog(null, "Encountered error: " + e.toString());
return;
}


this.clearCache();

JOptionPane.showMessageDialog(null, "Sever configured and running!");
}

Expand Down

0 comments on commit b228dd9

Please sign in to comment.