Fix: Don't activate/deactive objects when we don't have a database connection.

This commit is contained in:
Gunnar Beutner 2013-07-22 13:44:08 +02:00
parent 0829d8e17e
commit a7548a5fae
1 changed files with 7 additions and 0 deletions

View File

@ -237,6 +237,10 @@ Dictionary::Ptr MysqlDbConnection::FetchRow(MYSQL_RES *result)
void MysqlDbConnection::ActivateObject(const DbObject::Ptr& dbobj) void MysqlDbConnection::ActivateObject(const DbObject::Ptr& dbobj)
{ {
boost::mutex::scoped_lock lock(m_ConnectionMutex); boost::mutex::scoped_lock lock(m_ConnectionMutex);
if (!m_Connected)
return;
DbReference dbref = GetReference(dbobj); DbReference dbref = GetReference(dbobj);
std::ostringstream qbuf; std::ostringstream qbuf;
@ -256,6 +260,9 @@ void MysqlDbConnection::DeactivateObject(const DbObject::Ptr& dbobj)
{ {
boost::mutex::scoped_lock lock(m_ConnectionMutex); boost::mutex::scoped_lock lock(m_ConnectionMutex);
if (!m_Connected)
return;
DbReference dbref = GetReference(dbobj); DbReference dbref = GetReference(dbobj);
if (!dbref.IsValid()) if (!dbref.IsValid())