Hold a WeakViewHandle in BufferElement

Otherwise, the element never goes away because the view never goes away because the element is holding a strong reference.

Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
This commit is contained in:
Nathan Sobo
2021-05-06 15:13:01 -06:00
co-authored by Max Brunsfeld
parent 7717700b2c
commit 008f2b905b
2 changed files with 22 additions and 16 deletions
+2 -2
View File
@@ -2161,8 +2161,8 @@ impl Entity for BufferView {
}
impl View for BufferView {
fn render<'a>(&self, app: &AppContext) -> ElementBox {
BufferElement::new(self.handle.upgrade(app).unwrap()).boxed()
fn render<'a>(&self, _: &AppContext) -> ElementBox {
BufferElement::new(self.handle.clone()).boxed()
}
fn ui_name() -> &'static str {