mirror of https://github.com/Icinga/icinga2.git
Merge pull request #9284 from Icinga/bugfix/icingadb-array-locking
Add missing array locking in IcingaDB::GetArrayDeletedValues()
This commit is contained in:
commit
fb2a58f177
|
@ -266,14 +266,23 @@ std::vector<Value> IcingaDB::GetArrayDeletedValues(const Array::Ptr& arrayOld, c
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!arrayNew) {
|
if (!arrayNew) {
|
||||||
|
ObjectLock olock (arrayOld);
|
||||||
return std::vector<Value>(arrayOld->Begin(), arrayOld->End());
|
return std::vector<Value>(arrayOld->Begin(), arrayOld->End());
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<Value> vectorOld(arrayOld->Begin(), arrayOld->End());
|
std::vector<Value> vectorOld;
|
||||||
|
{
|
||||||
|
ObjectLock olock (arrayOld);
|
||||||
|
vectorOld.assign(arrayOld->Begin(), arrayOld->End());
|
||||||
|
}
|
||||||
std::sort(vectorOld.begin(), vectorOld.end());
|
std::sort(vectorOld.begin(), vectorOld.end());
|
||||||
vectorOld.erase(std::unique(vectorOld.begin(), vectorOld.end()), vectorOld.end());
|
vectorOld.erase(std::unique(vectorOld.begin(), vectorOld.end()), vectorOld.end());
|
||||||
|
|
||||||
std::vector<Value> vectorNew(arrayNew->Begin(), arrayNew->End());
|
std::vector<Value> vectorNew;
|
||||||
|
{
|
||||||
|
ObjectLock olock (arrayNew);
|
||||||
|
vectorNew.assign(arrayNew->Begin(), arrayNew->End());
|
||||||
|
}
|
||||||
std::sort(vectorNew.begin(), vectorNew.end());
|
std::sort(vectorNew.begin(), vectorNew.end());
|
||||||
vectorNew.erase(std::unique(vectorNew.begin(), vectorNew.end()), vectorNew.end());
|
vectorNew.erase(std::unique(vectorNew.begin(), vectorNew.end()), vectorNew.end());
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue