Added missing object locks in the MacroProcessor class.

This commit is contained in:
Gunnar Beutner 2013-02-28 10:27:20 +01:00
parent ee4c8a5755
commit 5300bf8473

View File

@ -31,6 +31,8 @@ Value MacroProcessor::ResolveMacros(const Value& cmd, const Dictionary::Ptr& mac
Dictionary::Ptr resultDict = boost::make_shared<Dictionary>(); Dictionary::Ptr resultDict = boost::make_shared<Dictionary>();
Dictionary::Ptr dict = cmd; Dictionary::Ptr dict = cmd;
ObjectLock olock(dict);
Value arg; Value arg;
BOOST_FOREACH(tie(tuples::ignore, arg), dict) { BOOST_FOREACH(tie(tuples::ignore, arg), dict) {
resultDict->Add(InternalResolveMacros(arg, macros)); 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) 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; offset = 0;
String result = str; String result = str;
@ -78,6 +81,8 @@ Dictionary::Ptr MacroProcessor::MergeMacroDicts(const vector<Dictionary::Ptr>& d
if (!dict) if (!dict)
continue; continue;
ObjectLock olock(dict);
String key; String key;
Value value; Value value;
BOOST_FOREACH(tie(key, value), dict) { BOOST_FOREACH(tie(key, value), dict) {