about summary refs log tree commit diff homepage
path: root/lib/Solver/CachingSolver.cpp
diff options
context:
space:
mode:
authorDaniel Schemmel <daniel@schemmel.net>2023-03-24 01:11:58 +0000
committerCristian Cadar <c.cadar@imperial.ac.uk>2023-04-21 13:07:31 +0100
commitb0f645687c36237a58a571b5b416717a871f2bf2 (patch)
treed0a5f01c894b83757d51e62ff0b45320dc455e6c /lib/Solver/CachingSolver.cpp
parent3a8fe1c957b74d087471db3e2fab6cf27acf26d4 (diff)
downloadklee-b0f645687c36237a58a571b5b416717a871f2bf2.tar.gz
use unique_ptr in CachingSolver
Diffstat (limited to 'lib/Solver/CachingSolver.cpp')
-rw-r--r--lib/Solver/CachingSolver.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Solver/CachingSolver.cpp b/lib/Solver/CachingSolver.cpp
index 4a4c8e28..5d85062d 100644
--- a/lib/Solver/CachingSolver.cpp
+++ b/lib/Solver/CachingSolver.cpp
@@ -16,6 +16,7 @@
 #include "klee/Solver/SolverImpl.h"
 #include "klee/Solver/SolverStats.h"
 
+#include <memory>
 #include <unordered_map>
 
 using namespace klee;
@@ -62,12 +63,11 @@ private:
                              CacheEntryHash>
       cache_map;
 
-  Solver *solver;
+  std::unique_ptr<Solver> solver;
   cache_map cache;
 
 public:
   CachingSolver(Solver *s) : solver(s) {}
-  ~CachingSolver() { cache.clear(); delete solver; }
 
   bool computeValidity(const Query&, Solver::Validity &result);
   bool computeTruth(const Query&, bool &isValid);