mirror of
https://github.com/zed-industries/zed.git
synced 2025-01-28 13:18:04 +00:00
Implement Drop on AnyViewHandle
This was a pretty bad oversight.
This commit is contained in:
parent
6cb656db9a
commit
7717700b2c
1 changed files with 8 additions and 0 deletions
|
@ -2363,6 +2363,14 @@ impl<T: View> From<ViewHandle<T>> for AnyViewHandle {
|
|||
}
|
||||
}
|
||||
|
||||
impl Drop for AnyViewHandle {
|
||||
fn drop(&mut self) {
|
||||
if let Some(ref_counts) = self.ref_counts.upgrade() {
|
||||
ref_counts.lock().dec_view(self.window_id, self.view_id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub struct WeakViewHandle<T> {
|
||||
window_id: usize,
|
||||
view_id: usize,
|
||||
|
|
Loading…
Reference in a new issue