From 70d7768868df45b16753477b9edabee2d3ad73d0 Mon Sep 17 00:00:00 2001 From: Noisyfox Date: Mon, 10 Mar 2025 21:35:44 +0800 Subject: [PATCH] Fix crash when slicing batch PA pattern test (#8786) * Fix crash when slicing batch PA pattern test (SoftFever/OrcaSlicer#8777) --- src/libslic3r/GCodeWriter.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/libslic3r/GCodeWriter.cpp b/src/libslic3r/GCodeWriter.cpp index d17527d115..e72bbb6685 100644 --- a/src/libslic3r/GCodeWriter.cpp +++ b/src/libslic3r/GCodeWriter.cpp @@ -45,6 +45,7 @@ void GCodeWriter::apply_print_config(const PrintConfig &print_config) void GCodeWriter::set_extruders(std::vector extruder_ids) { std::sort(extruder_ids.begin(), extruder_ids.end()); + m_extruder = nullptr; // this points to object inside `m_extruders`, so should be cleared too m_extruders.clear(); m_extruders.reserve(extruder_ids.size()); for (unsigned int extruder_id : extruder_ids)