Reduce memory usage during gcode output by discarding processed layers.

As each layer is processed, it increases in size by a factor of two
or three so by the end the layer list gets quite big.  So this removes
the list entry after it's been processed.
This commit is contained in:
Mark Hindess 2012-06-29 12:33:30 +01:00
parent 2e1649e6b5
commit 4d1551c305

View file

@ -587,6 +587,7 @@ sub write_gcode {
for my $obj_copy (@$object_copies) {
my ($obj_idx, $copy) = @$obj_copy;
my $layer = $self->objects->[$obj_idx]->layers->[$layer_id];
$self->objects->[$obj_idx]->layers->[$layer_id] = undef;
# retract explicitely because changing the shift_[xy] properties below
# won't always trigger the automatic retraction