Free G-code result buffers with clear_and_shrink

This commit is contained in:
SoftFever
2026-10-13 18:05:51 +08:00
parent f33a9bf999
commit bf5a378479
+3 -6
View File
@@ -2602,16 +2602,13 @@ void GCodeProcessorResult::reset() {
//BBS: add mutex for protection of gcode result
lock();
// release rather than clear: these two are sized by the print - one entry per move and one
// per g-code line - and a reset is where the memory is expected to go back to the allocator
// (see BackgroundSlicingProcess::apply()). The capacity would not be reused anyway: the
// result is refilled by move-assigning the processor's own result.
moves = std::vector<MoveVertex>();
// moves and lines_ends grow with the print: free them, as no reset result reuses the capacity.
clear_and_shrink(moves);
plate_mass = {};
object_masses.clear();
body_masses.clear();
support_masses.clear();
lines_ends = std::vector<size_t>();
clear_and_shrink(lines_ends);
printable_area = Pointfs();
//BBS: add bed exclude area
bed_exclude_area = Pointfs();