diff options
| author | 2025-09-10 14:40:06 +0100 | |
|---|---|---|
| committer | 2025-09-13 09:14:23 +0100 | |
| commit | a391f202f5cccfeaa55ed30cd43f1b2a697aeb73 (patch) | |
| tree | 9328d121a1732062a871b255d1559eb39331b9b5 /enigma-swing | |
| parent | Add a way for plugins to invalidate data (mappings, javadocs, decompile), and... (diff) | |
| download | enigma-a391f202f5cccfeaa55ed30cd43f1b2a697aeb73.tar.gz enigma-a391f202f5cccfeaa55ed30cd43f1b2a697aeb73.tar.xz enigma-a391f202f5cccfeaa55ed30cd43f1b2a697aeb73.zip | |
Fix threading issues in ClassHandleProvider that are likely to come up if a plugin frequently invalidates class handles
Diffstat (limited to 'enigma-swing')
| -rw-r--r-- | enigma-swing/src/main/java/cuchaz/enigma/gui/panels/EditorPanel.java | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/enigma-swing/src/main/java/cuchaz/enigma/gui/panels/EditorPanel.java b/enigma-swing/src/main/java/cuchaz/enigma/gui/panels/EditorPanel.java index fb30f87a..6b341ee0 100644 --- a/enigma-swing/src/main/java/cuchaz/enigma/gui/panels/EditorPanel.java +++ b/enigma-swing/src/main/java/cuchaz/enigma/gui/panels/EditorPanel.java | |||
| @@ -333,15 +333,13 @@ public class EditorPanel { | |||
| 333 | } | 333 | } |
| 334 | 334 | ||
| 335 | private void handleDecompilerResult(Result<DecompiledClassSource, ClassHandleError> res) { | 335 | private void handleDecompilerResult(Result<DecompiledClassSource, ClassHandleError> res) { |
| 336 | SwingUtilities.invokeLater(() -> { | 336 | if (res.isOk()) { |
| 337 | if (res.isOk()) { | 337 | this.setSource(res.unwrap()); |
| 338 | this.setSource(res.unwrap()); | 338 | } else { |
| 339 | } else { | 339 | this.displayError(res.unwrapErr()); |
| 340 | this.displayError(res.unwrapErr()); | 340 | } |
| 341 | } | ||
| 342 | 341 | ||
| 343 | this.nextReference = null; | 342 | this.nextReference = null; |
| 344 | }); | ||
| 345 | } | 343 | } |
| 346 | 344 | ||
| 347 | public void displayError(ClassHandleError t) { | 345 | public void displayError(ClassHandleError t) { |