mirror of
				https://github.com/Z3Prover/z3
				synced 2025-11-04 05:19:11 +00:00 
			
		
		
		
	vector: make expand_vector() less prone to mem leaks by calling the destructors after move
This commit is contained in:
		
							parent
							
								
									e7f0f3b834
								
							
						
					
					
						commit
						d18e975a49
					
				
					 1 changed files with 1 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -91,6 +91,7 @@ class vector {
 | 
			
		|||
                int i = 0;
 | 
			
		||||
                for (auto I = old_data; I != old_data + old_size; ++I) {
 | 
			
		||||
                    new (&m_data[i++]) T(std::move(*I));
 | 
			
		||||
                    I->~T();
 | 
			
		||||
                }
 | 
			
		||||
                memory::deallocate(old_mem);
 | 
			
		||||
            }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue