Fix list::remove when trying to remove first element of the list (SIGSEGV)

This commit is contained in:
Quentin Legot
2023-04-05 13:07:10 +02:00
parent 24be35547e
commit 8b3a3bebe7
2 changed files with 24 additions and 2 deletions

View File

@ -141,6 +141,8 @@ impl ThreadManager {
let old_status = machine.interrupt.set_status(InterruptStatus::InterruptOff);
self.g_thread_to_be_destroyed = Option::Some(Rc::clone(&thread));
self.g_alive.remove(Rc::clone(&thread));
#[cfg(debug_assertions)]
println!("Sleeping thread {}", thread.borrow().get_name());
// g_objets_addrs->removeObject(self.thread) // a ajouté plus tard
self.thread_sleep(machine, Rc::clone(&thread));
machine.interrupt.set_status(old_status);