mirror of
				https://github.com/Z3Prover/z3
				synced 2025-10-31 19:52:29 +00:00 
			
		
		
		
	setting ast to null on destructor to deal with #2350
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
		
							parent
							
								
									333b32b0d2
								
							
						
					
					
						commit
						63a952f254
					
				
					 1 changed files with 2 additions and 1 deletions
				
			
		|  | @ -301,8 +301,9 @@ class AstRef(Z3PPObject): | ||||||
|         Z3_inc_ref(self.ctx.ref(), self.as_ast()) |         Z3_inc_ref(self.ctx.ref(), self.as_ast()) | ||||||
| 
 | 
 | ||||||
|     def __del__(self): |     def __del__(self): | ||||||
|         if self.ctx.ref() is not None: |         if self.ctx.ref() is not None and self.ast is not None: | ||||||
|            Z3_dec_ref(self.ctx.ref(), self.as_ast()) |            Z3_dec_ref(self.ctx.ref(), self.as_ast()) | ||||||
|  |            self.ast = None | ||||||
| 
 | 
 | ||||||
|     def __deepcopy__(self, memo={}): |     def __deepcopy__(self, memo={}): | ||||||
|         return _to_ast_ref(self.ast, self.ctx) |         return _to_ast_ref(self.ast, self.ctx) | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue