Mercurial > hg > orthanc
comparison Core/SQLite/StatementReference.cpp @ 656:08eca5d86aad
fixes to cppcheck
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Mon, 04 Nov 2013 11:19:31 +0100 |
parents | bdd72233b105 |
children | 5425bb6f1ea5 |
comparison
equal
deleted
inserted
replaced
655:93adc693cc60 | 656:08eca5d86aad |
---|---|
37 #include "StatementReference.h" | 37 #include "StatementReference.h" |
38 | 38 |
39 #include "../OrthancException.h" | 39 #include "../OrthancException.h" |
40 | 40 |
41 #include <cassert> | 41 #include <cassert> |
42 #include <glog/logging.h> | |
42 #include "sqlite3.h" | 43 #include "sqlite3.h" |
43 | 44 |
44 namespace Orthanc | 45 namespace Orthanc |
45 { | 46 { |
46 namespace SQLite | 47 namespace SQLite |
101 { | 102 { |
102 if (IsRoot()) | 103 if (IsRoot()) |
103 { | 104 { |
104 if (refCount_ != 0) | 105 if (refCount_ != 0) |
105 { | 106 { |
106 // There remain references to this object | 107 // There remain references to this object. We cannot throw |
107 throw OrthancException(ErrorCode_InternalError); | 108 // an exception because: |
109 // http://www.parashift.com/c++-faq/dtors-shouldnt-throw.html | |
110 | |
111 LOG(ERROR) << "Bad value of the reference counter"; | |
108 } | 112 } |
109 else if (statement_ != NULL) | 113 else if (statement_ != NULL) |
110 { | 114 { |
111 sqlite3_finalize(statement_); | 115 sqlite3_finalize(statement_); |
112 } | 116 } |