diff --git a/services/status/src/ecup.rs b/services/status/src/ecup.rs index b2995e472..accfa36f1 100644 --- a/services/status/src/ecup.rs +++ b/services/status/src/ecup.rs @@ -340,6 +340,7 @@ pub(crate) fn ecupdate_thread(sid: xous::SID) { }, Some(UpdateOp::Quit) => { log::info!("quitting updater thread"); + xous::return_scalar(msg.sender, 1).unwrap(); break; }, None => { diff --git a/services/status/src/main.rs b/services/status/src/main.rs index 35a9a3c75..63788b3e8 100644 --- a/services/status/src/main.rs +++ b/services/status/src/main.rs @@ -323,6 +323,13 @@ fn wrapped_main() -> ! { } _ => log::error!("Invalid return type from UpdateAuto"), } + #[cfg(not(feature="dbg-ecupdate"))] + { // if we're not debugging, quit the updater thread -- might as well free up the memory and connections if nobody will ever use it again. + send_message(ecup_conn, + Message::new_blocking_scalar(ecup::UpdateOp::Quit.to_usize().unwrap(), 0, 0, 0, 0) + ).expect("couldn't quit updater thread"); + unsafe{xous::disconnect(ecup_conn).ok()}; + } let keys = Arc::new(Mutex::new( root_keys::RootKeys::new(&xns, None)