Skip to content

Commit

Permalink
Merge a31847d into 264ea7e
Browse files Browse the repository at this point in the history
  • Loading branch information
Marco Gario committed Oct 14, 2018
2 parents 264ea7e + a31847d commit ee23d98
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions pysmt/solvers/z3.py
Original file line number Diff line number Diff line change
Expand Up @@ -911,8 +911,12 @@ def _type_to_z3(self, tp):

def __del__(self):
# Cleaning-up Z3Converter requires dec-ref'ing the terms in the cache
for t in self.memoization.values():
z3.Z3_dec_ref(self.ctx.ref(), t)
if self.ctx.ref():
# Check that there is still a context object
# This might not be the case if we are using the global context
# and the interpreter is shutting down
for t in self.memoization.values():
z3.Z3_dec_ref(self.ctx.ref(), t)

# EOC Z3Converter

Expand Down

0 comments on commit ee23d98

Please sign in to comment.