Skip to content

Commit

Permalink
Fix crash when loading gcode file twice (#7217)
Browse files Browse the repository at this point in the history
* Fix ASAN use-after-free error when loading 3mf file with gcode by drag-and-drop

* Fix crash when loading gcode file twice
  • Loading branch information
Noisyfox authored Oct 26, 2024
1 parent 88ca0bc commit 2348928
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/slic3r/GUI/Plater.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -12347,15 +12351,13 @@ 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;
}

if (result) {
p->m_is_slicing = true;
this->SetDropTarget(nullptr);
}

bool clean_gcode_toolpaths = true;
Expand Down

0 comments on commit 2348928

Please sign in to comment.