From a26732e1fa8258840aa2a179f30c35fa4f992376 Mon Sep 17 00:00:00 2001 From: Corwin Kuiper Date: Sun, 6 Jun 2021 10:58:29 +0100 Subject: [PATCH] clear object when dropped --- agb/src/display/object.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/agb/src/display/object.rs b/agb/src/display/object.rs index 2d83d871..effe2fc2 100644 --- a/agb/src/display/object.rs +++ b/agb/src/display/object.rs @@ -166,6 +166,10 @@ fn set_bits(current: u16, value: u16, length: u16, shift: u16) -> u16 { impl Drop for ObjectLoan<'_> { fn drop(&mut self) { + let attributes = ObjectAttribute::new(); + unsafe { + attributes.commit(self.index); + } let mut objs = self.objects.borrow_mut(); objs.set(self.index as usize, false); }