Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 16 additions & 3 deletions packages/desktop/src-tauri/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -281,10 +281,23 @@ pub fn run() {
)
.expect("Failed to export typescript bindings");

// Kill any orphaned processes from previous runs on macOS
// This prevents memory accumulation from zombie processes
#[cfg(all(target_os = "macos", not(debug_assertions)))]
let _ = std::process::Command::new("killall")
.arg("opencode-cli")
.output();
{
// Kill opencode server processes
let _ = std::process::Command::new("pkill")
.args(["-f", "OpenWork.app/Contents/MacOS/opencode"])
.output();
// Kill openwrk daemon processes
let _ = std::process::Command::new("pkill")
.args(["-f", "OpenWork.app/Contents/MacOS/openwrk"])
.output();
// Kill openwork-server processes
let _ = std::process::Command::new("pkill")
.args(["-f", "OpenWork.app/Contents/MacOS/openwork-server"])
.output();
}

let mut builder = tauri::Builder::default()
.plugin(tauri_plugin_single_instance::init(|app, _args, _cwd| {
Expand Down
Loading