Skip to content

Commit 74c52a8

Browse files
committed
fix(gui): resolve exception in search dialog on project reload (skylot#2714)
1 parent 39e7b82 commit 74c52a8

2 files changed

Lines changed: 7 additions & 6 deletions

File tree

jadx-gui/src/main/java/jadx/gui/JadxWrapper.java

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,11 +86,13 @@ public void open() {
8686

8787
// TODO: check and move into core package
8888
public void unloadClasses() {
89-
for (ClassNode cls : getDecompiler().getRoot().getClasses()) {
90-
ProcessState clsState = cls.getState();
91-
cls.unload();
92-
cls.setState(clsState == PROCESS_COMPLETE ? GENERATED_AND_UNLOADED : NOT_LOADED);
93-
}
89+
getCurrentDecompiler().ifPresent(decompiler -> {
90+
for (ClassNode cls : decompiler.getRoot().getClasses()) {
91+
ProcessState clsState = cls.getState();
92+
cls.unload();
93+
cls.setState(clsState == PROCESS_COMPLETE ? GENERATED_AND_UNLOADED : NOT_LOADED);
94+
}
95+
});
9496
}
9597

9698
public void close() {

jadx-gui/src/main/java/jadx/gui/ui/dialog/SearchDialog.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,6 @@ public void dispose() {
205205
removeActiveTabListener();
206206
searchBackgroundExecutor.execute(() -> {
207207
stopSearchTask();
208-
mainWindow.getBackgroundExecutor().waitForComplete();
209208
unloadTempData();
210209
});
211210
super.dispose();

0 commit comments

Comments
 (0)