mirror of https://github.com/Icinga/icinga2.git
ido: Object map should not be static.
This commit is contained in:
parent
3261ad7106
commit
7f9fdde77e
|
@ -86,13 +86,13 @@ DbObject::Ptr DbType::GetOrCreateObjectByName(const String& name1, const String&
|
||||||
|
|
||||||
ObjectLock olock(this);
|
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;
|
return it->second;
|
||||||
|
|
||||||
DbObject::Ptr dbobj = m_ObjectFactory(GetSelf(), name1, name2);
|
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;
|
return dbobj;
|
||||||
}
|
}
|
||||||
|
@ -111,12 +111,3 @@ DbType::TypeMap& DbType::GetTypes(void)
|
||||||
static DbType::TypeMap tm;
|
static DbType::TypeMap tm;
|
||||||
return tm;
|
return tm;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Caller must hold object mutex.
|
|
||||||
*/
|
|
||||||
DbType::ObjectMap& DbType::GetObjects(void)
|
|
||||||
{
|
|
||||||
static DbType::ObjectMap om;
|
|
||||||
return om;
|
|
||||||
}
|
|
||||||
|
|
|
@ -67,7 +67,7 @@ private:
|
||||||
static boost::mutex& GetStaticMutex(void);
|
static boost::mutex& GetStaticMutex(void);
|
||||||
static TypeMap& GetTypes(void);
|
static TypeMap& GetTypes(void);
|
||||||
|
|
||||||
ObjectMap& GetObjects(void);
|
ObjectMap m_Objects;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue