clear object when dropped

This commit is contained in:
Corwin Kuiper 2021-06-06 10:58:29 +01:00 committed by Corwin
parent 13dc368d18
commit a26732e1fa

View file

@ -166,6 +166,10 @@ fn set_bits(current: u16, value: u16, length: u16, shift: u16) -> u16 {
impl Drop for ObjectLoan<'_> { impl Drop for ObjectLoan<'_> {
fn drop(&mut self) { fn drop(&mut self) {
let attributes = ObjectAttribute::new();
unsafe {
attributes.commit(self.index);
}
let mut objs = self.objects.borrow_mut(); let mut objs = self.objects.borrow_mut();
objs.set(self.index as usize, false); objs.set(self.index as usize, false);
} }