Checkpoint: Fix downcasting

This commit is contained in:
Marshall Bowers 2023-09-29 22:53:24 -04:00
parent f50a23accd
commit c7fc5f3ab7
5 changed files with 65 additions and 43 deletions

View file

@ -232,6 +232,7 @@ impl<Thread: 'static + Send + Sync> AppContext<Thread> {
}
fn update<R>(&mut self, update: impl FnOnce(&mut Self) -> R) -> R {
dbg!("update");
self.pending_updates += 1;
let result = update(self);
self.pending_updates -= 1;
@ -242,6 +243,8 @@ impl<Thread: 'static + Send + Sync> AppContext<Thread> {
}
fn flush_effects(&mut self) {
dbg!("Flush effects");
while let Some(effect) = self.pending_effects.pop_front() {
match effect {
Effect::Notify(entity_id) => self.apply_notify_effect(entity_id),