Fix the Clone impl for AnyViewHandle
This commit is contained in:
+12
-1
@@ -2389,7 +2389,6 @@ impl<T> Handle<T> for ViewHandle<T> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone)]
|
|
||||||
pub struct AnyViewHandle {
|
pub struct AnyViewHandle {
|
||||||
window_id: usize,
|
window_id: usize,
|
||||||
view_id: usize,
|
view_id: usize,
|
||||||
@@ -2425,6 +2424,18 @@ impl AnyViewHandle {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl Clone for AnyViewHandle {
|
||||||
|
fn clone(&self) -> Self {
|
||||||
|
self.ref_counts.lock().inc_entity(self.view_id);
|
||||||
|
Self {
|
||||||
|
window_id: self.window_id,
|
||||||
|
view_id: self.view_id,
|
||||||
|
view_type: self.view_type,
|
||||||
|
ref_counts: self.ref_counts.clone(),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl<T: View> From<&ViewHandle<T>> for AnyViewHandle {
|
impl<T: View> From<&ViewHandle<T>> for AnyViewHandle {
|
||||||
fn from(handle: &ViewHandle<T>) -> Self {
|
fn from(handle: &ViewHandle<T>) -> Self {
|
||||||
handle.ref_counts.lock().inc_entity(handle.view_id);
|
handle.ref_counts.lock().inc_entity(handle.view_id);
|
||||||
|
|||||||
Reference in New Issue
Block a user