mirror of
				https://github.com/SoftFever/OrcaSlicer.git
				synced 2025-10-31 04:31:15 -06:00 
			
		
		
		
	Fix arrange crash with ASAN
This commit is contained in:
		
							parent
							
								
									7fe691f14e
								
							
						
					
					
						commit
						177a96a768
					
				
					 1 changed files with 8 additions and 2 deletions
				
			
		|  | @ -33,10 +33,16 @@ protected: | |||
|         // then it should be removed from the list
 | ||||
|         auto it = c.begin(); | ||||
|         while (it != c.end() && !stopcond_()) { | ||||
|             Placer p{bin}; | ||||
|             p.configure(pcfg); | ||||
|              | ||||
|             // WARNING: The copy of itm needs to be created before Placer.
 | ||||
|             // Placer is working with references and its destructor still
 | ||||
|             // manipulates the item this is why the order of stack creation
 | ||||
|             // matters here.            
 | ||||
|             const Item& itm = *it; | ||||
|             Item cpy{itm}; | ||||
|              | ||||
|             Placer p{bin}; | ||||
|             p.configure(pcfg); | ||||
|             if (!p.pack(cpy)) it = c.erase(it); | ||||
|             else it++; | ||||
|         } | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 tamasmeszaros
						tamasmeszaros