mirror of
				https://github.com/SoftFever/OrcaSlicer.git
				synced 2025-10-31 04:31:15 -06:00 
			
		
		
		
	Fix memory leak in avoid_crossing_perimeters. #1044
This commit is contained in:
		
							parent
							
								
									813aa5b307
								
							
						
					
					
						commit
						9c122bda5e
					
				
					 2 changed files with 15 additions and 9 deletions
				
			
		|  | @ -881,24 +881,24 @@ sub write_gcode { | |||
|                 if ($Slic3r::Config->avoid_crossing_perimeters) { | ||||
|                     push @islands, map +{ perimeters => [], fills => [] }, @{$layer->slices}; | ||||
|                     PERIMETER: foreach my $perimeter (@{$layerm->perimeters}) { | ||||
|                         $perimeter = $perimeter->unpack; | ||||
|                         my $p = $perimeter->unpack; | ||||
|                         for my $i (0 .. $#{$layer->slices}-1) { | ||||
|                             if ($layer->slices->[$i]->contour->encloses_point($perimeter->first_point)) { | ||||
|                                 push @{ $islands[$i]{perimeters} }, $perimeter; | ||||
|                             if ($layer->slices->[$i]->contour->encloses_point($p->first_point)) { | ||||
|                                 push @{ $islands[$i]{perimeters} }, $p; | ||||
|                                 next PERIMETER; | ||||
|                             } | ||||
|                         } | ||||
|                         push @{ $islands[-1]{perimeters} }, $perimeter; # optimization | ||||
|                         push @{ $islands[-1]{perimeters} }, $p; # optimization | ||||
|                     } | ||||
|                     FILL: foreach my $fill (@{$layerm->fills}) { | ||||
|                         my $f = $fill->unpack; | ||||
|                         for my $i (0 .. $#{$layer->slices}-1) { | ||||
|                             $fill = $fill->unpack; | ||||
|                             if ($layer->slices->[$i]->contour->encloses_point($fill->first_point)) { | ||||
|                                 push @{ $islands[$i]{fills} }, $fill; | ||||
|                             if ($layer->slices->[$i]->contour->encloses_point($f->first_point)) { | ||||
|                                 push @{ $islands[$i]{fills} }, $f; | ||||
|                                 next FILL; | ||||
|                             } | ||||
|                         } | ||||
|                         push @{ $islands[-1]{fills} }, $fill; # optimization | ||||
|                         push @{ $islands[-1]{fills} }, $f; # optimization | ||||
|                     } | ||||
|                 } else { | ||||
|                     push @islands, { | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Alessandro Ranellucci
						Alessandro Ranellucci