Skip to content

Commit

Permalink
Merge pull request #419 from pysmt/i417/cvc4_memleak
Browse files Browse the repository at this point in the history
CVC4: Free C++ SmtEngine when Solver is destroyed
  • Loading branch information
mikand committed Jul 25, 2017
2 parents a085125 + ae49cc2 commit 8d05074
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pysmt/solvers/cvc4.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,9 @@ def __init__(self, environment, logic, **options):

def reset_assertions(self):
del self.cvc4
self.cvc4 = CVC4.SmtEngine(self.em)
# CVC4's SWIG interface is not acquiring ownership of the
# SmtEngine object. Forcing it here.
self.cvc4 = CVC4.SmtEngine(self.em); self.cvc4.thisown=1
self.options(self)
self.declarations = set()
self.cvc4.setLogic(self.logic_name)
Expand Down

0 comments on commit 8d05074

Please sign in to comment.