ido: Object map should not be static.

This commit is contained in:
Gunnar Beutner 2013-09-11 12:47:49 +02:00
parent 3261ad7106
commit 7f9fdde77e
2 changed files with 4 additions and 13 deletions

View File

@ -86,13 +86,13 @@ DbObject::Ptr DbType::GetOrCreateObjectByName(const String& name1, const String&
ObjectLock olock(this);
DbType::ObjectMap::const_iterator it = GetObjects().find(std::make_pair(name1, name2));
DbType::ObjectMap::const_iterator it = m_Objects.find(std::make_pair(name1, name2));
if (it != GetObjects().end())
if (it != m_Objects.end())
return it->second;
DbObject::Ptr dbobj = m_ObjectFactory(GetSelf(), name1, name2);
GetObjects()[std::make_pair(name1, name2)] = dbobj;
m_Objects[std::make_pair(name1, name2)] = dbobj;
return dbobj;
}
@ -111,12 +111,3 @@ DbType::TypeMap& DbType::GetTypes(void)
static DbType::TypeMap tm;
return tm;
}
/**
* Caller must hold object mutex.
*/
DbType::ObjectMap& DbType::GetObjects(void)
{
static DbType::ObjectMap om;
return om;
}

View File

@ -67,7 +67,7 @@ private:
static boost::mutex& GetStaticMutex(void);
static TypeMap& GetTypes(void);
ObjectMap& GetObjects(void);
ObjectMap m_Objects;
};
/**