Skip to content

Conversation

@AhmedMagedC
Copy link
Contributor

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

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
ContributorAuthor

Done! what do you think @Stefterv?

@Stefterv
Copy link
Collaborator

Perfect! thank you very much

@SteftervStefterv added this to the 4.4.4 milestone May 5, 2025
@SteftervStefterv modified the milestones: 4.4.4, 4.4.5May 12, 2025
@SableRafSableRaf merged commit 29d8272 into processing:mainJul 11, 2025
@SableRaf
Copy link
Collaborator

SableRaf commented Jul 11, 2025

Thanks for your contribution @AhmedMagedC 💙

@all-contributors please add @AhmedMagedC for code

@allcontributors
Copy link
Contributor

@SableRaf

I've put up a pull request to add @AhmedMagedC! 🎉

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Completed

Development

Successfully merging this pull request may close these issues.

Second app instance does not exit

3 participants

@AhmedMagedC@Stefterv@SableRaf