From 7f8f36bf40de37ba7a6326f4fb40338e96f9ec89 Mon Sep 17 00:00:00 2001 From: Noisyfox Date: Sat, 7 Jun 2025 11:03:25 +0800 Subject: [PATCH] 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) --- src/slic3r/GUI/EditGCodeDialog.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/slic3r/GUI/EditGCodeDialog.cpp b/src/slic3r/GUI/EditGCodeDialog.cpp index 171c0c3080..c50b86d32a 100644 --- a/src/slic3r/GUI/EditGCodeDialog.cpp +++ b/src/slic3r/GUI/EditGCodeDialog.cpp @@ -670,6 +670,7 @@ wxDataViewItem ParamsModel::Delete(const wxDataViewItem& item) ParamsNode* node = static_cast(item.GetID()); if (!node) // happens if item.IsOk()==false return ret_item; + const bool is_item_enabled = node->IsEnabled(); // first remove the node from the parent's array of children; // NOTE: m_group_nodes is only a vector of _pointers_ @@ -700,8 +701,12 @@ wxDataViewItem ParamsModel::Delete(const wxDataViewItem& item) ret_item = parent; } - // notify control - ItemDeleted(parent, item); + // Orca: notify enabled item only, because disabled items have already been removed from UI, + // so attempt to notify it cases a crash. + if (is_item_enabled) { + // notify control + ItemDeleted(parent, item); + } return ret_item; }