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

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
Contributor 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
@Stefterv Stefterv modified the milestones: 4.4.4, 4.4.5 May 12, 2025
@SableRaf SableRaf merged commit 29d8272 into processing:main Jul 11, 2025
@SableRaf
Copy link
Collaborator

SableRaf commented Jul 11, 2025

Thanks for your contribution @AhmedMagedC 💙

@all-contributors please add @AhmedMagedC for code

Copy link
Contributor

@SableRaf

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

Sign up for free to 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