mirror of
https://github.com/Z3Prover/z3
synced 2025-04-24 17:45:32 +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())
|
||||
|
||||
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())
|
||||
self.ast = None
|
||||
|
||||
def __deepcopy__(self, memo={}):
|
||||
return _to_ast_ref(self.ast, self.ctx)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue