diff options
Diffstat (limited to 'mg_db_gd_sqlite.c')
| -rw-r--r-- | mg_db_gd_sqlite.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/mg_db_gd_sqlite.c b/mg_db_gd_sqlite.c index a7a6198..68fb03e 100644 --- a/mg_db_gd_sqlite.c +++ b/mg_db_gd_sqlite.c @@ -98,6 +98,8 @@ mgDbGd::mgDbGd(bool SeparateThread) { mgDbGd::~mgDbGd() { sqlite3_close (m_db); +// this does not release all fds even if no transaction is pending! +// try not to call sqlite3_open more often than necessary m_db = 0; } @@ -282,10 +284,10 @@ mgDbGd::ConnectDatabase () { if (stat(the_setup.DbDatadir,&stbuf)) mkdir(the_setup.DbDatadir,0755); char *s=sqlite3_mprintf("%s/%s.sqlite",the_setup.DbDatadir,the_setup.DbName); - mgDebug(1,"%X opening data base %s",m_db,s); // rework this when sqlite3.5 is available, use sqlite3_open_v2 // and do not try to create db here int rc = sqlite3_open(s,&m_db); + mgDebug(1,"opening data base %s with handle %04X",s,m_db); if (rc!=SQLITE_OK) mgWarning("Cannot open/create SQLite database %s:%d/%s", s,rc,sqlite3_errmsg(m_db)); |
