Skip to content

Second app instance does not exit #1066

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
Junology opened this issue Apr 29, 2025 · 3 comments · May be fixed by #1072
Open

Second app instance does not exit #1066

Junology opened this issue Apr 29, 2025 · 3 comments · May be fixed by #1072
Assignees
Labels
bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed pde Processing Development Environment

Comments

@Junology
Copy link
Contributor

Most appropriate sub-area of Processing 4?

PDE

Processing version

4.4.3 (portable)

Operating system

Linux (Ubuntu 20.04 x64)

Steps to reproduce this

"1. Download processing-4.4.3-linux-x64-portable.zip, extract it, and cd Processing/bin

  1. ./Processing & and wait for Processing to launch.

  2. ./Processing & again and wait for the second Processing IDE to launch.

  3. Close both Processing windows.

  4. ps | grep Processing and you'll see the second Processing process is still alive."

snippet

Additional context

I also observed the same happens for local build with Gradle.
The problem is not critical since Ctrl-C terminates it anyway, but it is a bit bothering when it happens.

Would you like to work on the issue?

No; I am not familier with Kotlin, sorry.

@Junology Junology added the bug Something isn't working label Apr 29, 2025
@Stefterv Stefterv added help wanted Extra attention is needed good first issue Good for newcomers pde Processing Development Environment labels Apr 29, 2025
@Stefterv
Copy link
Collaborator

Good point, I've also seen this happen on macOS. As for a bit of background:

static boolean alreadyRunning(String[] args) {
return Preferences.get(SERVER_PORT) != null && sendArguments(args);
}
I suspect something in the send arguments code might not be finishing, keeping the second instance of Processing alive.

@Junology
Copy link
Contributor Author

Glancing at the source, I noticed that existing instance check, i.e., SingleInstance.alreadyRunning is performed in processing.app.Base. IMO, the method should be called from the genuine startup code processing.app.ui.Start.main, right? Otherwise, we have to see the splash screen in each time we open a sketch from file managers, as it is now.

@AhmedMagedC
Copy link

I can also reproduce this bug on windows
I have also observed that when you open multiple instances like three processes and you try to close any of them, they all remain exist, until you close every one of them then only one of the processes exits and the rest remains

i would love to work on this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed pde Processing Development Environment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants