File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -251,7 +251,16 @@ static private void createAndShowGUI(String[] args) {
251
251
252
252
// long t2 = System.currentTimeMillis();
253
253
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 ) {
255
264
// Set the look and feel before opening the window
256
265
try {
257
266
Platform .setLookAndFeel ();
@@ -324,8 +333,6 @@ static private void createAndShowGUI(String[] args) {
324
333
325
334
// long t10 = System.currentTimeMillis();
326
335
// System.out.println("startup took " + (t2-t1) + " " + (t3-t2) + " " + (t4-t3) + " " + (t5-t4) + " " + (t6-t5) + " " + (t10-t6) + " ms");
327
- } else {
328
- System .exit (0 );
329
336
}
330
337
}
331
338
You can’t perform that action at this time.
0 commit comments