Skip to content

Commit

Permalink
stop all instances of the eaCefSubprocess and ea desktop, to avoid ab…
Browse files Browse the repository at this point in the history
…andoned eaCef processes when using the ea desktop seeding method
  • Loading branch information
zefanjajobse committed Oct 30, 2024
1 parent 82ecf22 commit 5ff7f0a
Showing 1 changed file with 17 additions and 10 deletions.
27 changes: 17 additions & 10 deletions src/actions/launchers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -335,18 +335,25 @@ pub fn restart_ea_desktop() {
}

pub fn stop_ea_desktop() {
let origin_process = winproc::Process::from_name("EADesktop.exe");
match origin_process {
Ok(mut process) => match process.terminate(1) {
Ok(_) => {
log::info!("Closed EA Desktop");
sleep(Duration::from_secs(10));
match winproc::Process::all() {
Ok(processes) => {
for mut process in processes {
for item in ["EADesktop.exe", "EACefSubProcess.exe"].iter() {
if process.name().unwrap_or_default() == item.to_string() {
match process.terminate(1) {
Ok(_) => {
log::info!("Closed {}", item);
sleep(Duration::from_secs(10));
}
Err(e) => {
log::error!("failed to close {} (likely permissions): {}", item, e)
}
}
}
}
}
Err(e) => log::error!("failed to close EA Desktop (likely permissions): {}", e),
},
Err(_) => {
log::info!("EA desktop not found!");
}
Err(e) => log::error!("failed to access running processes, {:#?}", e),
}
}

Expand Down

0 comments on commit 5ff7f0a

Please sign in to comment.