mirror of
https://github.com/zed-industries/zed.git
synced 2024-11-08 07:35:01 +03:00
Fix memory leak in ListState
This commit is contained in:
parent
20e1044d49
commit
f832c0074f
@ -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 New Issue
Block a user