From 681227be7118fde3f1d6b062a457df70f912603d Mon Sep 17 00:00:00 2001 From: enricoturri1966 Date: Thu, 27 Apr 2023 10:42:30 +0200 Subject: [PATCH] Fixed crash in fff_print_tests --- src/libslic3r/GCode/GCodeProcessor.cpp | 2 ++ src/libslic3r/Print.cpp | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/libslic3r/GCode/GCodeProcessor.cpp b/src/libslic3r/GCode/GCodeProcessor.cpp index 51e4c88c1..d71dd347a 100644 --- a/src/libslic3r/GCode/GCodeProcessor.cpp +++ b/src/libslic3r/GCode/GCodeProcessor.cpp @@ -450,6 +450,7 @@ void GCodeProcessorResult::reset() { filament_cost = std::vector(MIN_EXTRUDERS_COUNT, DEFAULT_FILAMENT_COST); custom_gcode_per_print_z = std::vector(); spiral_vase_layers = std::vector>>(); + conflict_result = std::nullopt; time = 0; } #else @@ -468,6 +469,7 @@ void GCodeProcessorResult::reset() { filament_cost = std::vector(MIN_EXTRUDERS_COUNT, DEFAULT_FILAMENT_COST); custom_gcode_per_print_z = std::vector(); spiral_vase_layers = std::vector>>(); + conflict_result = std::nullopt; } #endif // ENABLE_GCODE_VIEWER_STATISTICS diff --git a/src/libslic3r/Print.cpp b/src/libslic3r/Print.cpp index 57ccc9a82..a184c1ccd 100644 --- a/src/libslic3r/Print.cpp +++ b/src/libslic3r/Print.cpp @@ -1001,7 +1001,8 @@ std::string Print::export_gcode(const std::string& path_template, GCodeProcessor std::unique_ptr gcode(new GCode); gcode->do_export(this, path.c_str(), result, thumbnail_cb); - result->conflict_result = m_conflict_result; + if (m_conflict_result.has_value()) + result->conflict_result = *m_conflict_result; return path.c_str(); }