mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-26 23:24:09 +02:00
Added missing object locks in the MacroProcessor class.
This commit is contained in:
parent
ee4c8a5755
commit
5300bf8473
@ -31,6 +31,8 @@ Value MacroProcessor::ResolveMacros(const Value& cmd, const Dictionary::Ptr& mac
|
||||
Dictionary::Ptr resultDict = boost::make_shared<Dictionary>();
|
||||
Dictionary::Ptr dict = cmd;
|
||||
|
||||
ObjectLock olock(dict);
|
||||
|
||||
Value arg;
|
||||
BOOST_FOREACH(tie(tuples::ignore, arg), dict) {
|
||||
resultDict->Add(InternalResolveMacros(arg, macros));
|
||||
@ -46,8 +48,9 @@ Value MacroProcessor::ResolveMacros(const Value& cmd, const Dictionary::Ptr& mac
|
||||
|
||||
String MacroProcessor::InternalResolveMacros(const String& str, const Dictionary::Ptr& macros)
|
||||
{
|
||||
size_t offset, pos_first, pos_second;
|
||||
ObjectLock olock(macros);
|
||||
|
||||
size_t offset, pos_first, pos_second;
|
||||
offset = 0;
|
||||
|
||||
String result = str;
|
||||
@ -78,6 +81,8 @@ Dictionary::Ptr MacroProcessor::MergeMacroDicts(const vector<Dictionary::Ptr>& d
|
||||
if (!dict)
|
||||
continue;
|
||||
|
||||
ObjectLock olock(dict);
|
||||
|
||||
String key;
|
||||
Value value;
|
||||
BOOST_FOREACH(tie(key, value), dict) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user