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) {
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
You can’t perform that action at this time.
0 commit comments