diff --git a/xs/src/libslic3r/GCode/PressureEqualizer.cpp b/xs/src/libslic3r/GCode/PressureEqualizer.cpp index e6b118a28..68e642f3c 100644 --- a/xs/src/libslic3r/GCode/PressureEqualizer.cpp +++ b/xs/src/libslic3r/GCode/PressureEqualizer.cpp @@ -26,7 +26,8 @@ void PressureEqualizer::reset() circular_buffer_items = 0; circular_buffer.assign(circular_buffer_size, GCodeLine()); - output_buffer.clear(); + // Preallocate some data, so that output_buffer.data() will return an empty string. + output_buffer.assign(32, 0); output_buffer_length = 0; m_current_extruder = 0;