diff --git a/lib/Slic3r/GUI/Dashboard.pm b/lib/Slic3r/GUI/Dashboard.pm index 0432046bb..72527ccf8 100644 --- a/lib/Slic3r/GUI/Dashboard.pm +++ b/lib/Slic3r/GUI/Dashboard.pm @@ -370,6 +370,7 @@ sub export_gcode { } else { $print->export_gcode(%params); } + $print->cleanup; Slic3r::GUI::warning_catcher($self)->($_) for @warnings; } $process_dialog->Destroy; diff --git a/lib/Slic3r/Print.pm b/lib/Slic3r/Print.pm index e3e9870e7..75bf7fb94 100644 --- a/lib/Slic3r/Print.pm +++ b/lib/Slic3r/Print.pm @@ -60,6 +60,14 @@ sub add_object_from_mesh { return $object; } +sub cleanup { + my $self = shift; + $_->cleanup for @{$self->objects}; + @{$self->skirt} = (); + $self->total_extrusion_length(0); + $self->processing_time(0); +} + sub layer_count { my $self = shift; my $count = 0; diff --git a/lib/Slic3r/Print/Object.pm b/lib/Slic3r/Print/Object.pm index c4211453e..64d7f37be 100644 --- a/lib/Slic3r/Print/Object.pm +++ b/lib/Slic3r/Print/Object.pm @@ -152,6 +152,11 @@ sub slice { if !@{$self->layers}; } +sub cleanup { + my $self = shift; + @{$self->layers} = (); +} + sub detect_surfaces_type { my $self = shift; Slic3r::debugf "Detecting solid surfaces...\n";