3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-10 19:27:06 +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:
Nikolaj Bjorner 2019-06-21 16:40:11 +02:00
parent 333b32b0d2
commit 63a952f254

View file

@ -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)