mirror of
https://github.com/zed-industries/zed.git
synced 2024-09-20 02:47:34 +03:00
In add_option_view
, avoid bumping view's ref counts if view is None
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
parent
bd573e0651
commit
0e93bc41dd
@ -1344,7 +1344,6 @@ impl MutableAppContext {
|
||||
{
|
||||
self.update(|this| {
|
||||
let view_id = post_inc(&mut this.next_entity_id);
|
||||
let handle = ViewHandle::new(window_id, view_id, &this.cx.ref_counts);
|
||||
let mut cx = ViewContext::new(this, window_id, view_id);
|
||||
let handle = if let Some(view) = build_view(&mut cx) {
|
||||
this.cx.views.insert((window_id, view_id), Box::new(view));
|
||||
@ -1355,7 +1354,7 @@ impl MutableAppContext {
|
||||
.updated
|
||||
.insert(view_id);
|
||||
}
|
||||
Some(handle)
|
||||
Some(ViewHandle::new(window_id, view_id, &this.cx.ref_counts))
|
||||
} else {
|
||||
None
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user