Avoid reference cycle between Client and its models

This commit is contained in:
Antonio Scandurra 2022-03-01 10:49:40 +01:00
parent 471ecae82c
commit 10a872a370
2 changed files with 24 additions and 8 deletions

View file

@ -3567,6 +3567,15 @@ impl AnyWeakModelHandle {
}
}
impl<T: Entity> From<WeakModelHandle<T>> for AnyWeakModelHandle {
fn from(handle: WeakModelHandle<T>) -> Self {
AnyWeakModelHandle {
model_id: handle.model_id,
model_type: TypeId::of::<T>(),
}
}
}
pub struct WeakViewHandle<T> {
window_id: usize,
view_id: usize,