We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c4c4644 commit a17c829Copy full SHA for a17c829
src/main/java/simpaths/experiment/SimPathsStart.java
@@ -108,13 +108,18 @@ public static void main(String[] args) {
108
109
if (!showGui) {
110
engine.startSimulation();
111
- while (engine.getRunningStatus()) try {
112
- TimeUnit.SECONDS.sleep(10);
113
- } catch (InterruptedException e) {
114
- System.err.println("Interrupted while waiting for simulation to complete.");
115
- return;
+ try {
+ while (engine.getRunningStatus()) {
+ TimeUnit.SECONDS.sleep(10);
+ } catch (InterruptedException e) {
116
+ System.err.println("Interrupted while waiting for simulation to complete.");
117
+ return;
118
+ }
119
120
+ } finally {
121
+ engine.quit();
122
}
- engine.quit();
123
124
125
0 commit comments