several fixes and changes

This commit is contained in:
FantasyPvP
2023-11-29 23:45:40 +00:00
parent d89a30d390
commit 7ae2308a83
10 changed files with 215 additions and 68 deletions
+4 -3
View File
@@ -96,7 +96,8 @@ impl Widget {
impl Drop for Widget {
fn drop(&mut self) {
GUITREE.lock().remove(self);
let removed = GUITREE.lock().remove(self);
drop(removed);
}
}
@@ -136,9 +137,9 @@ impl DataStore {
items.get(&id.id).cloned()
}
fn remove(&self, id: &Widget) {
fn remove(&self, id: &Widget) -> Option<Arc<Mutex<dyn CgComponent + Send + Sync>>> {
let mut items = self.items.lock();
items.remove(&id.id);
items.remove(&id.id)
}
}