diff --git a/src/slic3r/GUI/BackgroundSlicingProcess.cpp b/src/slic3r/GUI/BackgroundSlicingProcess.cpp index 602464bb86..e1dc565874 100644 --- a/src/slic3r/GUI/BackgroundSlicingProcess.cpp +++ b/src/slic3r/GUI/BackgroundSlicingProcess.cpp @@ -807,6 +807,10 @@ void BackgroundSlicingProcess::reset_export() if (!this->running()) { m_export_path.clear(); m_export_path_on_removable_media = false; + // A scheduled upload only leaves m_upload_job when prepare_upload() hands it to the print host + // job queue. If the run ended before that (a post-processing script or plugin failure, or a + // cancel), the job must not survive into the next plain slice, which would upload again. + m_upload_job = PrintHostJob(); // invalidate_step expects the mutex to be locked. std::scoped_lock lock(m_print->state_mutex()); this->invalidate_step(bspsGCodeFinalize); diff --git a/src/slic3r/GUI/BackgroundSlicingProcess.hpp b/src/slic3r/GUI/BackgroundSlicingProcess.hpp index 231bee811e..1ccd821190 100644 --- a/src/slic3r/GUI/BackgroundSlicingProcess.hpp +++ b/src/slic3r/GUI/BackgroundSlicingProcess.hpp @@ -166,7 +166,7 @@ public: // Set print host upload job data to be enqueued to the PrintHostJobQueue // after current print slicing is complete void schedule_upload(Slic3r::PrintHostJob upload_job); - // Clear m_export_path. + // Clear m_export_path and drop a scheduled upload that was not handed to the print host job queue. void reset_export(); // Once the G-code export is scheduled, the apply() methods will do nothing. bool is_export_scheduled() const { return ! m_export_path.empty(); }