Add missing locks in ApiListener::UpdateConfigDir

This commit is contained in:
Gunnar Beutner 2015-02-24 16:03:32 +01:00
parent 38deef0411
commit 5fe2536629
1 changed files with 15 additions and 11 deletions

View File

@ -72,6 +72,8 @@ bool ApiListener::UpdateConfigDir(const Dictionary::Ptr& oldConfig, const Dictio
return false; return false;
} }
{
ObjectLock olock(newConfig);
BOOST_FOREACH(const Dictionary::Pair& kv, newConfig) { BOOST_FOREACH(const Dictionary::Pair& kv, newConfig) {
if (oldConfig->Get(kv.first) != kv.second) { if (oldConfig->Get(kv.first) != kv.second) {
configChange = true; configChange = true;
@ -87,7 +89,9 @@ bool ApiListener::UpdateConfigDir(const Dictionary::Ptr& oldConfig, const Dictio
fp.close(); fp.close();
} }
} }
}
ObjectLock xlock(oldConfig);
BOOST_FOREACH(const Dictionary::Pair& kv, oldConfig) { BOOST_FOREACH(const Dictionary::Pair& kv, oldConfig) {
if (!newConfig->Contains(kv.first)) { if (!newConfig->Contains(kv.first)) {
configChange = true; configChange = true;