Skip to content

Terminate JVM of already running instances #1072

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

AhmedMagedC
Copy link

Resolves #1066

Changes

added System.exit(0)
why?
when new Processing instance opens, a client socket is instantiated and connected to the main server socket (initiated by the main instance), then the main instance handles opening the sketch
but what about the instance that created the socket in the first place? we didn't terminate it's JVM, so it remains consuming resources and doing pretty much nothing

Tests

i validate the changes by trying to locally build multiple instances
everything works as expected, and these instances automatically exits

@Stefterv
Copy link
Collaborator

Stefterv commented May 4, 2025

Hi @AhmedMagedC Looks good!

Code wise, would you be up for changing the code-flow that it becomes clearer when System.exit(0) is called?
Right now I'm a bit worried that it'll be missed the next time changes are made since the check is on line 254 and the action is on line 327

@AhmedMagedC
Copy link
Author

Done! what do you think @Stefterv?

@Stefterv
Copy link
Collaborator

Stefterv commented May 4, 2025

Perfect! thank you very much

@Stefterv Stefterv added this to the 4.4.4 milestone May 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Second app instance does not exit
2 participants