mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-16 08:38:26 +00:00
kernel: services: free servers on process termination
When a process is terminated, we disconnect it from all other processes. We also need to free the slot in the server table. Signed-off-by: Sean Cross <sean@xobs.io>
This commit is contained in:
parent
76b16579b0
commit
180c99aa8d
1 changed files with 10 additions and 0 deletions
|
|
@ -1936,6 +1936,16 @@ impl SystemServices {
|
|||
server.discard_messages_for_pid(target_pid);
|
||||
}
|
||||
}
|
||||
|
||||
// Now that the server has been "Disconnected", free the server entry.
|
||||
for server in self.servers.iter_mut() {
|
||||
if let Some(server_inner) = server {
|
||||
if server_inner.pid == target_pid {
|
||||
*server = None;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
let process = self.get_process_mut(target_pid)?;
|
||||
process.activate()?;
|
||||
let parent_pid = process.ppid;
|
||||
|
|
|
|||
Loading…
Reference in a new issue