Add LeakDetector for gpui2

Co-Authored-By: Julia <julia@zed.dev>
This commit is contained in:
Conrad Irwin 2024-01-04 20:16:25 -07:00
parent 22c3eb7d5f
commit 5037cca7ec
2 changed files with 126 additions and 3 deletions

View file

@ -143,6 +143,11 @@ impl<V: 'static> WeakView<V> {
let view = self.upgrade().context("error upgrading view")?;
Ok(view.update(cx, f)).flatten()
}
#[cfg(any(test, feature = "test-support"))]
pub fn assert_dropped(&self) {
self.model.assert_dropped()
}
}
impl<V> Clone for WeakView<V> {