add drop implementation to servers

This commit is contained in:
bunnie 2021-04-02 22:01:40 +08:00
parent 265f99c6ae
commit 25dc27f2f7
4 changed files with 26 additions and 1 deletions

View file

@ -37,3 +37,11 @@ impl Ticktimer {
).map(|_| ())
}
}
impl Drop for Ticktimer {
fn drop(&mut self) {
// de-allocate myself. It's unsafe because we are responsible to make sure nobody else is using the connection.
unsafe{xous::disconnect(self.conn).unwrap();}
}
}

View file

@ -37,3 +37,11 @@ impl Trng {
}
}
}
impl Drop for Trng {
fn drop(&mut self) {
// de-allocate myself. It's unsafe because we are responsible to make sure nobody else is using the connection.
unsafe{xous::disconnect(self.conn).unwrap();}
}
}

View file

@ -75,3 +75,11 @@ impl XousNames {
}
}
}
impl Drop for XousNames {
fn drop(&mut self) {
// de-allocate myself. It's unsafe because we are responsible to make sure nobody else is using the connection.
unsafe{xous::disconnect(self.conn).unwrap();}
}
}

View file

@ -48,7 +48,8 @@ fn try_main() -> Result<(), DynError> {
"xous-names",
//"keyboard",
"trng",
"llio",
"llio", // still to convert
"rkyv-test-client",
"rkyv-test-server",
];