Skip to content

Kill spawned processes on App close from Javascript Code #5870

Answered by FabianLars
touhidurrr asked this question in Q&A
Discussion options

You must be logged in to vote

hmm, maybe try the window specific listen methods (like appWindow.listen), which also has a helper function: https://tauri.app/v1/api/js/window#oncloserequested

Hi! I am using Tauri for a while to write production apps. I am not being able to close spawned processes when the app is closed. How do I do it?

It depends. If it's spawned as a sidecar then Tauri should handle it itself. The problem is that some (sidecar) apps spawn multiple processes without cleaning up after themselves. This is currently only solvable in Rust, see #3273 for example.
If we're talking about "normal" Commands (not sidecars) then you need to handle it yourself.

Replies: 4 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by touhidurrr
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@FabianLars
Comment options

@touhidurrr
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants