mirror of https://github.com/Icinga/icinga2.git
ConfigObject: Initialize local static var at declaration to ensure thread safety
This commit is contained in:
parent
fb21345bfd
commit
f00a3c9693
|
@ -413,13 +413,7 @@ void ConfigObject::OnConfigLoaded()
|
|||
|
||||
void ConfigObject::OnAllConfigLoaded()
|
||||
{
|
||||
static ConfigType *ctype;
|
||||
|
||||
if (!ctype) {
|
||||
Type::Ptr type = Type::GetByName("Zone");
|
||||
ctype = dynamic_cast<ConfigType *>(type.get());
|
||||
}
|
||||
|
||||
static ConfigType *ctype = dynamic_cast<ConfigType *>(Type::GetByName("Zone").get());
|
||||
String zoneName = GetZoneName();
|
||||
|
||||
if (!zoneName.IsEmpty())
|
||||
|
|
Loading…
Reference in New Issue