From dc9ff8b8261b1be3efcdbffdb066a8feb0415301 Mon Sep 17 00:00:00 2001 From: "lane.wei" Date: Wed, 28 Sep 2022 09:35:43 +0800 Subject: [PATCH] Fix: fix the crash issue when switch language under Debug mode Change-Id: Ie6f978099c9b12f69d340ff39552eebafc10ba38 --- src/slic3r/GUI/GUI_Factories.cpp | 3 +++ src/slic3r/GUI/Plater.cpp | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/slic3r/GUI/GUI_Factories.cpp b/src/slic3r/GUI/GUI_Factories.cpp index 434022788..5a3ff3959 100644 --- a/src/slic3r/GUI/GUI_Factories.cpp +++ b/src/slic3r/GUI/GUI_Factories.cpp @@ -1343,6 +1343,9 @@ void MenuFactory::append_menu_item_change_filament(wxMenu* menu) return; std::vector icons = get_extruder_color_icons(true); + if (icons.size() < filaments_cnt) { + BOOST_LOG_TRIVIAL(warning) << boost::format("Warning: icons size %1%, filaments_cnt=%2%")%icons.size()%filaments_cnt; + } wxMenu* extruder_selection_menu = new wxMenu(); const wxString& name = sels.Count() == 1 ? names[0] : names[1]; diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index a1061f69d..3717acaa9 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -3829,7 +3829,7 @@ void Plater::priv::update_print_volume_state() //BBS: use the plate's bounding box instead of the bed's PartPlate* pp = partplate_list.get_curr_plate(); BuildVolume build_volume(pp->get_shape(), this->bed.build_volume().printable_height()); - this->q->model().update_print_volume_state(build_volume); + this->model.update_print_volume_state(build_volume); } void Plater::priv::process_validation_warning(StringObjectException const &warning) const @@ -3909,7 +3909,7 @@ unsigned int Plater::priv::update_background_process(bool force_validation, bool this->partplate_list.update_slice_context_to_current_plate(background_process); this->preview->update_gcode_result(partplate_list.get_current_slice_result()); } - Print::ApplyStatus invalidated = background_process.apply(q->model(), wxGetApp().preset_bundle->full_config()); + Print::ApplyStatus invalidated = background_process.apply(this->model, wxGetApp().preset_bundle->full_config()); if ((invalidated == Print::APPLY_STATUS_CHANGED) || (invalidated == Print::APPLY_STATUS_INVALIDATED)) // BBS: add only gcode mode