diff options
author | Andres Noetzli <andres.noetzli@gmail.com> | 2018-03-26 12:34:05 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-26 12:34:05 -0700 |
commit | 8b5b4e7c9df5bd9d5959c7c92a5b28c951881d49 (patch) | |
tree | 7aa1cd6abc54c4ca9c44f91daedcbbaefef48819 /src/prop/bvminisat/bvminisat.h | |
parent | a4c2248a49506f60d555cbd7b99784b20ff02aef (diff) |
Fix memory leak in bvminisat (#1710)
While reviewing #1695, I realized that bvminisat is leaking memory for
each call to setNotify(). This commit uses std::unique_ptr to fix the
issue. It also adds std::unique_ptr to manage d_minisat.
Diffstat (limited to 'src/prop/bvminisat/bvminisat.h')
-rw-r--r-- | src/prop/bvminisat/bvminisat.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/prop/bvminisat/bvminisat.h b/src/prop/bvminisat/bvminisat.h index 4395cdf6d..6081296cb 100644 --- a/src/prop/bvminisat/bvminisat.h +++ b/src/prop/bvminisat/bvminisat.h @@ -18,6 +18,8 @@ #pragma once +#include <memory> + #include "context/cdo.h" #include "proof/clause_id.h" #include "prop/bvminisat/simp/SimpSolver.h" @@ -49,8 +51,8 @@ class BVMinisatSatSolver : public BVSatSolverInterface, void safePoint(unsigned amount) override { d_notify->safePoint(amount); } }; - BVMinisat::SimpSolver* d_minisat; - MinisatNotify* d_minisatNotify; + std::unique_ptr<BVMinisat::SimpSolver> d_minisat; + std::unique_ptr<MinisatNotify> d_minisatNotify; unsigned d_assertionsCount; context::CDO<unsigned> d_assertionsRealCount; |