Fix in sqlite3

git-svn-id: svn://ultimatepp.org/upp/trunk@833 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2009-02-02 12:46:49 +00:00
parent 0dfc5f6265
commit 2b8226e0e5

View file

@ -273,8 +273,13 @@ bool Sqlite3Session::Open(const char* filename) {
// However, using the ATTACH sql command, it can connect to more databases.
// I don't know how to get the list of attached databases from the API
current_dbname = "main";
bool opened = (SQLITE_OK == sqlite3_open(filename, &db));
return opened;
if(SQLITE_OK == sqlite3_open(filename, &db))
return true;
if(db) {
sqlite3_close(db);
db = NULL;
}
return false;
}
void Sqlite3Session::Close() {
if (NULL != db) {