Prevent ChildView from retaining an otherwise dropped view

This commit is contained in:
Antonio Scandurra 2022-10-13 14:53:58 +02:00
parent 26b03afa60
commit 06dfb74663
2 changed files with 17 additions and 7 deletions

View file

@ -4732,6 +4732,10 @@ pub struct AnyWeakViewHandle {
}
impl AnyWeakViewHandle {
pub fn id(&self) -> usize {
self.view_id
}
pub fn upgrade(&self, cx: &impl UpgradeViewHandle) -> Option<AnyViewHandle> {
cx.upgrade_any_view_handle(self)
}