about summary refs log tree commit diff homepage
diff options
context:
space:
mode:
-rw-r--r--lib/Solver/QueryLoggingSolver.cpp4
-rw-r--r--lib/Solver/QueryLoggingSolver.h6
2 files changed, 3 insertions, 7 deletions
diff --git a/lib/Solver/QueryLoggingSolver.cpp b/lib/Solver/QueryLoggingSolver.cpp
index 4c3d9b30..c057751c 100644
--- a/lib/Solver/QueryLoggingSolver.cpp
+++ b/lib/Solver/QueryLoggingSolver.cpp
@@ -53,10 +53,6 @@ QueryLoggingSolver::QueryLoggingSolver(Solver *_solver, std::string path,
   assert(0 != solver);
 }
 
-QueryLoggingSolver::~QueryLoggingSolver() {
-  delete solver;
-}
-
 void QueryLoggingSolver::flushBufferConditionally(bool writeToFile) {
   logBuffer.flush();
   if (writeToFile) {
diff --git a/lib/Solver/QueryLoggingSolver.h b/lib/Solver/QueryLoggingSolver.h
index 65494498..76bba429 100644
--- a/lib/Solver/QueryLoggingSolver.h
+++ b/lib/Solver/QueryLoggingSolver.h
@@ -17,6 +17,8 @@
 
 #include "llvm/Support/raw_ostream.h"
 
+#include <memory>
+
 using namespace klee;
 
 /// This abstract class represents a solver that is capable of logging
@@ -26,7 +28,7 @@ using namespace klee;
 class QueryLoggingSolver : public SolverImpl {
 
 protected:
-  Solver *solver;
+  std::unique_ptr<Solver> solver;
   std::unique_ptr<llvm::raw_ostream> os;
   // @brief Buffer used by logBuffer
   std::string BufferString;
@@ -59,8 +61,6 @@ public:
   QueryLoggingSolver(Solver *_solver, std::string path, const std::string &commentSign,
                      time::Span queryTimeToLog, bool logTimedOut);
 
-  virtual ~QueryLoggingSolver();
-
   /// implementation of the SolverImpl interface
   bool computeTruth(const Query &query, bool &isValid);
   bool computeValidity(const Query &query, Solver::Validity &result);