Fix double read panic in nav history (#22754)
This one seems to be triggered when the assistant's `View<ContextEditor>` is leased during the call into `NavHistory::for_each_entry`, which then tries to read it again through the `ItemHandle` interface. Fix it by skipping entries that can't be read in the history iteration. Release Notes: - N/A
This commit is contained in:
parent
ef583e6b5a
commit
1d8bd151b7
4 changed files with 25 additions and 4 deletions
|
@ -3095,8 +3095,14 @@ impl Render for Pane {
|
|||
|
||||
impl ItemNavHistory {
|
||||
pub fn push<D: 'static + Send + Any>(&mut self, data: Option<D>, cx: &mut WindowContext) {
|
||||
self.history
|
||||
.push(data, self.item.clone(), self.is_preview, cx);
|
||||
if self
|
||||
.item
|
||||
.upgrade()
|
||||
.is_some_and(|item| item.include_in_nav_history())
|
||||
{
|
||||
self.history
|
||||
.push(data, self.item.clone(), self.is_preview, cx);
|
||||
}
|
||||
}
|
||||
|
||||
pub fn pop_backward(&mut self, cx: &mut WindowContext) -> Option<NavigationEntry> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue