fix(Live2D): pkill firefox-esr 杀整个进程树(含 contentproc 子进程)
This commit is contained in:
@@ -214,9 +214,10 @@ impl Plugin for VideoPlugin {
|
|||||||
let _ = child.kill();
|
let _ = child.kill();
|
||||||
let _ = child.wait();
|
let _ = child.wait();
|
||||||
}
|
}
|
||||||
|
// Firefox 会 fork 多个子进程,child.kill() 只杀父进程,用 pkill 兜底
|
||||||
let _ = std::process::Command::new("pkill")
|
let _ = std::process::Command::new("pkill")
|
||||||
.arg("-f")
|
.arg("-f")
|
||||||
.arg("live2d-display.html")
|
.arg("firefox-esr")
|
||||||
.output();
|
.output();
|
||||||
// 启动 Firefox kiosk 模式全屏显示 Live2D
|
// 启动 Firefox kiosk 模式全屏显示 Live2D
|
||||||
let port = config.remote_control.port;
|
let port = config.remote_control.port;
|
||||||
@@ -247,10 +248,10 @@ impl Plugin for VideoPlugin {
|
|||||||
let _ = child.kill();
|
let _ = child.kill();
|
||||||
let _ = child.wait();
|
let _ = child.wait();
|
||||||
}
|
}
|
||||||
// Firefox 会 fork 子进程,child.kill() 只杀父进程,用 pkill 兜底
|
// Firefox 会 fork 多个子进程,child.kill() 只杀父进程,用 pkill 兜底
|
||||||
let _ = std::process::Command::new("pkill")
|
let _ = std::process::Command::new("pkill")
|
||||||
.arg("-f")
|
.arg("-f")
|
||||||
.arg("live2d-display.html")
|
.arg("firefox-esr")
|
||||||
.output();
|
.output();
|
||||||
println!("[VideoPlugin] 切回视频模式:Firefox kiosk 已关闭");
|
println!("[VideoPlugin] 切回视频模式:Firefox kiosk 已关闭");
|
||||||
|
|
||||||
@@ -306,7 +307,7 @@ impl Plugin for VideoPlugin {
|
|||||||
}
|
}
|
||||||
let _ = std::process::Command::new("pkill")
|
let _ = std::process::Command::new("pkill")
|
||||||
.arg("-f")
|
.arg("-f")
|
||||||
.arg("live2d-display.html")
|
.arg("firefox-esr")
|
||||||
.output();
|
.output();
|
||||||
|
|
||||||
self.publish_status();
|
self.publish_status();
|
||||||
|
|||||||
Reference in New Issue
Block a user