mirror of
https://github.com/zed-industries/zed.git
synced 2024-12-27 02:48:34 +00:00
Fix memory leak in ListState
This commit is contained in:
parent
20e1044d49
commit
f832c0074f
1 changed files with 2 additions and 1 deletions
|
@ -352,10 +352,11 @@ impl ListState {
|
|||
{
|
||||
let mut items = SumTree::new();
|
||||
items.extend((0..element_count).map(|_| ListItem::Unrendered), &());
|
||||
let handle = cx.handle();
|
||||
let handle = cx.weak_handle();
|
||||
Self(Rc::new(RefCell::new(StateInner {
|
||||
last_layout_width: None,
|
||||
render_item: Box::new(move |ix, cx| {
|
||||
let handle = handle.upgrade(cx)?;
|
||||
Some(cx.render(&handle, |view, cx| render_item(view, ix, cx)))
|
||||
}),
|
||||
rendered_range: 0..0,
|
||||
|
|
Loading…
Reference in a new issue