Fixed crash in fff_print_tests

This commit is contained in:
enricoturri1966 2023-04-27 10:42:30 +02:00 committed by Lukas Matena
parent efe00f310b
commit 681227be71
2 changed files with 4 additions and 1 deletions

View File

@ -450,6 +450,7 @@ void GCodeProcessorResult::reset() {
filament_cost = std::vector<float>(MIN_EXTRUDERS_COUNT, DEFAULT_FILAMENT_COST);
custom_gcode_per_print_z = std::vector<CustomGCode::Item>();
spiral_vase_layers = std::vector<std::pair<float, std::pair<size_t, size_t>>>();
conflict_result = std::nullopt;
time = 0;
}
#else
@ -468,6 +469,7 @@ void GCodeProcessorResult::reset() {
filament_cost = std::vector<float>(MIN_EXTRUDERS_COUNT, DEFAULT_FILAMENT_COST);
custom_gcode_per_print_z = std::vector<CustomGCode::Item>();
spiral_vase_layers = std::vector<std::pair<float, std::pair<size_t, size_t>>>();
conflict_result = std::nullopt;
}
#endif // ENABLE_GCODE_VIEWER_STATISTICS

View File

@ -1001,7 +1001,8 @@ std::string Print::export_gcode(const std::string& path_template, GCodeProcessor
std::unique_ptr<GCode> 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();
}