Fixed leaking threads in simulations

This commit is contained in:
Sampo Niskanen 2012-03-13 06:01:43 +00:00
parent dabfa28b9d
commit ac51ec6b5a
2 changed files with 21 additions and 17 deletions

View File

@ -1,3 +1,11 @@
2012-03-13 Sampo Niskanne
* [BUG] Threads piled up when running simulations
2012-03-11 Sampo Niskanen
* Update copyright statements
2012-02-19 Sampo Niskanen
* Display computed motor class

View File

@ -58,11 +58,7 @@ public class SimulationRunDialog extends JDialog {
private static final double APOGEE_PROGRESS = 0.7;
/*
* The executor service is not static since we want concurrent simulation
* dialogs to run in parallel, ie. they both have their own executor service.
*/
private final ExecutorService executor = Executors.newFixedThreadPool(
private final static ExecutorService executor = Executors.newFixedThreadPool(
SwingPreferences.getMaxThreadCount());
@ -85,7 +81,7 @@ public class SimulationRunDialog extends JDialog {
public SimulationRunDialog(Window window, Simulation... simulations) {
//// Running simulations...
super(window, trans.get("SimuRunDlg.title.RunSim"), Dialog.ModalityType.DOCUMENT_MODAL);
super(window, trans.get("SimuRunDlg.title.RunSim"), Dialog.ModalityType.APPLICATION_MODAL);
if (simulations.length == 0) {
throw new IllegalArgumentException("Called with no simulations to run");