Skip to content

Commit e8903a8

Browse files
committed
making the code clearer
1 parent 6c50d40 commit e8903a8

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

app/src/processing/app/Base.java

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,16 @@ static private void createAndShowGUI(String[] args) {
251251

252252
// long t2 = System.currentTimeMillis();
253253

254-
if (DEBUG || !SingleInstance.alreadyRunning(args)) {
254+
// boolean flag indicating whether to create new server instance or not
255+
boolean createNewInstance = DEBUG || !SingleInstance.alreadyRunning(args);
256+
257+
// free up resources by terminating the JVM
258+
if(!createNewInstance){
259+
System.exit(0);
260+
return;
261+
}
262+
263+
if (createNewInstance) {
255264
// Set the look and feel before opening the window
256265
try {
257266
Platform.setLookAndFeel();
@@ -324,8 +333,6 @@ static private void createAndShowGUI(String[] args) {
324333

325334
// long t10 = System.currentTimeMillis();
326335
// System.out.println("startup took " + (t2-t1) + " " + (t3-t2) + " " + (t4-t3) + " " + (t5-t4) + " " + (t6-t5) + " " + (t10-t6) + " ms");
327-
} else {
328-
System.exit(0);
329336
}
330337
}
331338

0 commit comments

Comments
 (0)