git://source.jalview.org
/
jalview.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2ca18cf
)
JAL-4217 try really hard to shut down and dispose of Desktop resources and any lurkin...
author
James Procter
<j.procter@dundee.ac.uk>
Fri, 30 Jun 2023 11:58:55 +0000
(12:58 +0100)
committer
James Procter
<j.procter@dundee.ac.uk>
Fri, 30 Jun 2023 11:58:55 +0000
(12:58 +0100)
src/jalview/gui/Desktop.java
patch
|
blob
|
history
diff --git
a/src/jalview/gui/Desktop.java
b/src/jalview/gui/Desktop.java
index
b901ae4
..
36d6434
100644
(file)
--- a/
src/jalview/gui/Desktop.java
+++ b/
src/jalview/gui/Desktop.java
@@
-3623,8
+3623,22
@@
public class Desktop extends jalview.jbgui.GDesktop
{
Desktop.instance.closeAll_actionPerformed(null);
Desktop.instance.setVisible(false);
- Desktop.instance.dispose();
+ Desktop us = Desktop.instance;
Desktop.instance = null;
+ // call dispose in a separate thread - try to avoid indirect deadlocks
+ new Thread(new Runnable() {
+ @Override
+ public void run()
+ {
+ ExecutorService dex = us.dialogExecutor;
+ if (dex!=null) {
+ dex.shutdownNow();
+ us.dialogExecutor=null;
+ us.block.drainPermits();
+ }
+ us.dispose();
+ }
+ }).start();
}
}