fix(v9): 5 bugs — GUI deferred until VST loaded (no white window), fixed retry 8x500ms, VST3 folder resolve for auto-load, sustain-CC64 dropped after STOP, taskkill process tree on exit, Synth+GUI same row in TCP
This commit is contained in:
+21
-8
@@ -48,20 +48,31 @@ fn kill_bridge(app: &AppHandle) -> bool {
|
||||
Err(_) => return false,
|
||||
};
|
||||
match guard.take() {
|
||||
Some(child) => match child.kill() {
|
||||
Ok(()) => {
|
||||
Some(child) => {
|
||||
let ok = kill_process_tree(&child) || child.kill().is_ok();
|
||||
if ok {
|
||||
println!("Native Host Bridge killed (restart)");
|
||||
true
|
||||
} else {
|
||||
println!("Bridge kill failed");
|
||||
}
|
||||
Err(e) => {
|
||||
println!("Bridge kill failed: {e}");
|
||||
false
|
||||
}
|
||||
},
|
||||
ok
|
||||
}
|
||||
None => false,
|
||||
}
|
||||
}
|
||||
|
||||
/// Kill a child plus its whole process tree via taskkill /T /F. The engine
|
||||
/// (PyInstaller ONEDIR) and bridge are direct children, but /T guarantees no
|
||||
/// orphan subprocess stays behind when the DAW window closes.
|
||||
fn kill_process_tree(child: &CommandChild) -> bool {
|
||||
let pid = child.pid();
|
||||
std::process::Command::new("taskkill")
|
||||
.args(["/PID", &pid.to_string(), "/T", "/F"])
|
||||
.status()
|
||||
.map(|s| s.success())
|
||||
.unwrap_or(false)
|
||||
}
|
||||
|
||||
/// Audio frame pushed to the WebView (bridge SHM -> `bridge-audio` event).
|
||||
#[derive(Clone, serde::Serialize)]
|
||||
struct AudioFrame {
|
||||
@@ -479,6 +490,7 @@ pub fn run() {
|
||||
.ok()
|
||||
.and_then(|mut lock| lock.take());
|
||||
if let Some(child) = child {
|
||||
kill_process_tree(&child);
|
||||
let _ = child.kill();
|
||||
println!("daw_engine sidecar terminated.");
|
||||
}
|
||||
@@ -490,6 +502,7 @@ pub fn run() {
|
||||
.ok()
|
||||
.and_then(|mut lock| lock.take());
|
||||
if let Some(child) = bridge_child {
|
||||
kill_process_tree(&child);
|
||||
let _ = child.kill();
|
||||
println!("daw_vst_bridge sidecar terminated.");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user