From 2348928b25aef86b918949424b146971f4de1ba5 Mon Sep 17 00:00:00 2001 From: Noisyfox Date: Sat, 26 Oct 2024 21:29:03 +0800 Subject: [PATCH] Fix crash when loading gcode file twice (#7217) * Fix ASAN use-after-free error when loading 3mf file with gcode by drag-and-drop * Fix crash when loading gcode file twice --- src/slic3r/GUI/Plater.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index b51937e43c..f3782be140 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -10128,6 +10128,10 @@ void Plater::load_gcode(const wxString& filename) set_project_filename(filename); } + // Orca: Fix crash when loading gcode file multiple times + if (m_only_gcode) { + p->view3D->get_canvas3d()->remove_raycasters_for_picking(SceneRaycaster::EType::Bed); + } } void Plater::reload_gcode_from_disk() @@ -12347,7 +12351,6 @@ void Plater::reslice() // Post the "complete" callback message, so that it will slice the next plate soon wxQueueEvent(this, evt.Clone()); p->m_is_slicing = true; - this->SetDropTarget(nullptr); if (p->m_cur_slice_plate == 0) reset_gcode_toolpaths(); return; @@ -12355,7 +12358,6 @@ void Plater::reslice() if (result) { p->m_is_slicing = true; - this->SetDropTarget(nullptr); } bool clean_gcode_toolpaths = true;