Replace ViewContext::spawn with ViewContext::spawn_weak

This commit is contained in:
Antonio Scandurra 2023-04-26 10:23:27 +02:00
parent 09f7e41907
commit 94c2eaad23
20 changed files with 83 additions and 73 deletions

View file

@ -238,7 +238,7 @@ impl<D: PickerDelegate> Picker<D> {
pub fn update_matches(&mut self, query: String, cx: &mut ViewContext<Self>) {
let update = self.delegate.update_matches(query, cx);
self.matches_updated(cx);
self.pending_update_matches = cx.spawn_weak(|this, mut cx| async move {
self.pending_update_matches = cx.spawn(|this, mut cx| async move {
update.await;
this.upgrade(&cx)?
.update(&mut cx, |this, cx| this.matches_updated(cx))