From 1ba4227633fd6cb19f8dfb65f5c80c6a6f22f2de Mon Sep 17 00:00:00 2001 From: YuSanka Date: Fri, 11 Nov 2022 13:38:54 +0100 Subject: [PATCH] Fix for #SPE-1370 - Slicer crash when delete more volumes together Bug was caused by changes in https://github.com/Prusa-Development/PrusaSlicerPrivate/commit/13e4e85e3d2b53382915909c46b2340abd88aac1 So, revert related parts of code. --- src/slic3r/GUI/GUI_ObjectList.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/slic3r/GUI/GUI_ObjectList.cpp b/src/slic3r/GUI/GUI_ObjectList.cpp index 517b4a704e..fdce59f677 100644 --- a/src/slic3r/GUI/GUI_ObjectList.cpp +++ b/src/slic3r/GUI/GUI_ObjectList.cpp @@ -1864,12 +1864,10 @@ bool ObjectList::del_subobject_item(wxDataViewItem& item) // If last volume item with warning was deleted, unmark object item if (type & itVolume) { - add_volumes_to_object_in_list(obj_idx); const std::string& icon_name = get_warning_icon_name(object(obj_idx)->get_object_stl_stats()); m_objects_model->UpdateWarningIcon(parent, icon_name); } - else - m_objects_model->Delete(item); + m_objects_model->Delete(item); update_info_items(obj_idx); @@ -3031,7 +3029,7 @@ bool ObjectList::delete_from_model_and_list(const std::vector& it if (!del_subobject_from_object(item->obj_idx, item->sub_obj_idx, item->type)) continue; if (item->type&itVolume) { - add_volumes_to_object_in_list(item->obj_idx); + m_objects_model->Delete(m_objects_model->GetItemByVolumeId(item->obj_idx, item->sub_obj_idx)); ModelObject* obj = object(item->obj_idx); if (obj->volumes.size() == 1) { wxDataViewItem parent = m_objects_model->GetItemById(item->obj_idx);