This commit is contained in:
jiajen
2018-04-10 22:18:55 +08:00
committed by Aleksandar Fabijanic
parent 200a890434
commit 27e7e532cc
3 changed files with 22 additions and 3 deletions

View File

@@ -59,15 +59,17 @@ Utility::TypeMap Utility::_types;
Poco::Mutex Utility::_mutex;
Utility::SQLiteMutex::SQLiteMutex(sqlite3* pDB): _pMutex(sqlite3_db_mutex(pDB))
Utility::SQLiteMutex::SQLiteMutex(sqlite3* pDB): _pMutex((pDB) ? sqlite3_db_mutex(pDB) : 0)
{
sqlite3_mutex_enter(_pMutex);
if (_pMutex)
sqlite3_mutex_enter(_pMutex);
}
Utility::SQLiteMutex::~SQLiteMutex()
{
sqlite3_mutex_leave(_pMutex);
if (_pMutex)
sqlite3_mutex_leave(_pMutex);
}