mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-23 05:34:48 +02:00
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()
|
void ConfigObject::OnAllConfigLoaded()
|
||||||
{
|
{
|
||||||
static ConfigType *ctype;
|
static ConfigType *ctype = dynamic_cast<ConfigType *>(Type::GetByName("Zone").get());
|
||||||
|
|
||||||
if (!ctype) {
|
|
||||||
Type::Ptr type = Type::GetByName("Zone");
|
|
||||||
ctype = dynamic_cast<ConfigType *>(type.get());
|
|
||||||
}
|
|
||||||
|
|
||||||
String zoneName = GetZoneName();
|
String zoneName = GetZoneName();
|
||||||
|
|
||||||
if (!zoneName.IsEmpty())
|
if (!zoneName.IsEmpty())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user