Skip to content

Commit 29d8272

Browse files
authored
Merge pull request #1072 from AhmedMagedC/bug-fix
Terminate JVM of already running instances
2 parents 31a5ed4 + e8903a8 commit 29d8272

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

app/src/processing/app/Base.java

Lines changed: 10 additions & 1 deletion
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();

0 commit comments

Comments
 (0)