mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-06 14:37:36 -06:00
Fix crash on Linux when you searched the placeholder in gcode editor dialog (#9815)
Fix crash on Linux when you searched the placeholder in gcode editor dialog (SoftFever/OrcaSlicer#5671)
This commit is contained in:
parent
3900042280
commit
7f8f36bf40
1 changed files with 7 additions and 2 deletions
|
@ -670,6 +670,7 @@ wxDataViewItem ParamsModel::Delete(const wxDataViewItem& item)
|
||||||
ParamsNode* node = static_cast<ParamsNode*>(item.GetID());
|
ParamsNode* node = static_cast<ParamsNode*>(item.GetID());
|
||||||
if (!node) // happens if item.IsOk()==false
|
if (!node) // happens if item.IsOk()==false
|
||||||
return ret_item;
|
return ret_item;
|
||||||
|
const bool is_item_enabled = node->IsEnabled();
|
||||||
|
|
||||||
// first remove the node from the parent's array of children;
|
// first remove the node from the parent's array of children;
|
||||||
// NOTE: m_group_nodes is only a vector of _pointers_
|
// NOTE: m_group_nodes is only a vector of _pointers_
|
||||||
|
@ -700,8 +701,12 @@ wxDataViewItem ParamsModel::Delete(const wxDataViewItem& item)
|
||||||
ret_item = parent;
|
ret_item = parent;
|
||||||
}
|
}
|
||||||
|
|
||||||
// notify control
|
// Orca: notify enabled item only, because disabled items have already been removed from UI,
|
||||||
ItemDeleted(parent, item);
|
// so attempt to notify it cases a crash.
|
||||||
|
if (is_item_enabled) {
|
||||||
|
// notify control
|
||||||
|
ItemDeleted(parent, item);
|
||||||
|
}
|
||||||
return ret_item;
|
return ret_item;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue