X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=src%2FCppSQLite3.cpp;h=165f9110bebc1ed0baab8e592fc5e6d09ebebb9a;hb=ecd7eb9aca5b98c06f3ce9072b3f73fe71f1e4b0;hp=5d82661eb62e49e2fdce0f76ea6954d63bf62177;hpb=684add23b4f64cb3c6e39e12a4af20d2c2500df6;p=creaImageIO.git diff --git a/src/CppSQLite3.cpp b/src/CppSQLite3.cpp index 5d82661..165f911 100644 --- a/src/CppSQLite3.cpp +++ b/src/CppSQLite3.cpp @@ -45,21 +45,37 @@ int sqlite3_decode_binary(const unsigned char *in, unsigned char *out); //////////////////////////////////////////////////////////////////////////////// CppSQLite3Exception::CppSQLite3Exception(const int nErrCode, - char* szErrMess, - bool bDeleteMsg/*=true*/) : - mnErrCode(nErrCode) -{ - mpszErrMess = sqlite3_mprintf("%s[%d]: %s", - errorCodeAsString(nErrCode), - nErrCode, - szErrMess ? szErrMess : ""); - - if (bDeleteMsg && szErrMess) - { - sqlite3_free(szErrMess); - } + const char* szErrMess, + bool bDeleteMsg/*=true*/) : + mnErrCode(nErrCode) +{ + mpszErrMess = sqlite3_mprintf("%s[%d]: %s", + errorCodeAsString(nErrCode), + nErrCode, + szErrMess ? szErrMess : ""); + /* + if (bDeleteMsg && szErrMess) + { + sqlite3_free(szErrMess); + } + */ } +CppSQLite3Exception::CppSQLite3Exception(const int nErrCode, + char* szErrMess, + bool bDeleteMsg/*=true*/) : + mnErrCode(nErrCode) +{ + mpszErrMess = sqlite3_mprintf("%s[%d]: %s", + errorCodeAsString(nErrCode), + nErrCode, + szErrMess ? szErrMess : ""); + + if (bDeleteMsg && szErrMess) + { + sqlite3_free(szErrMess); + } +} CppSQLite3Exception::CppSQLite3Exception(const CppSQLite3Exception& e) : mnErrCode(e.mnErrCode) @@ -1310,7 +1326,7 @@ sqlite3_stmt* CppSQLite3DB::compile(const char* szSQL) ** data in an SQLite database. The code in this file is not used by any other ** part of the SQLite library. ** -** $Id: CppSQLite3.cpp,v 1.1 2008/09/26 14:15:48 guigues Exp $ +** $Id: CppSQLite3.cpp,v 1.2 2008/12/15 12:54:44 guigues Exp $ */ /*