diff Framework/Common/DatabaseManager.cpp @ 305:87f0e29a1dc1

added Dictionary::Clear()
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 12 Jul 2021 09:40:01 +0200
parents 86265ef5f3e3
children 7e9622c64c40
line wrap: on
line diff
--- a/Framework/Common/DatabaseManager.cpp	Fri Jul 09 17:23:24 2021 +0200
+++ b/Framework/Common/DatabaseManager.cpp	Mon Jul 12 09:40:01 2021 +0200
@@ -356,20 +356,14 @@
   
   void DatabaseManager::StatementBase::SetResult(IResult* result)
   {
-    std::unique_ptr<IResult> protection(result);
-    
-    if (result_.get() != NULL)
-    {
-      LOG(ERROR) << "Cannot execute twice a statement";
-      throw Orthanc::OrthancException(Orthanc::ErrorCode_BadSequenceOfCalls);
-    }
-
     if (result == NULL)
     {
       throw Orthanc::OrthancException(Orthanc::ErrorCode_NullPointer);
     }
-
-    result_.reset(protection.release());
+    else
+    {
+      result_.reset(result);
+    }
   }