Fix memory leak

This commit is contained in:
Quentin Legot
2023-03-22 14:30:21 +01:00
parent b9c329219a
commit b104bcc6da
2 changed files with 6 additions and 5 deletions

View File

@ -139,7 +139,7 @@ impl ThreadManager {
pub fn thread_finish(&mut self, machine: &mut Machine, thread: Rc<RefCell<Thread>>) {
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));
self.g_alive.remove(Rc::clone(&thread));
// g_objets_addrs->removeObject(self.thread) // a ajouté plus tard
self.thread_sleep(machine, Rc::clone(&thread));
machine.interrupt.set_status(old_status);