Fix deadlock in Service::RemoveAllComments().

Fixes #5721
This commit is contained in:
Gunnar Beutner 2014-03-07 09:53:21 +01:00
parent 319b233c6a
commit f5b4e951f0
1 changed files with 5 additions and 3 deletions

View File

@ -88,9 +88,11 @@ void Service::RemoveAllComments(void)
std::vector<String> ids;
Dictionary::Ptr comments = GetComments();
ObjectLock olock(comments);
BOOST_FOREACH(const Dictionary::Pair& kv, comments) {
ids.push_back(kv.first);
{
ObjectLock olock(comments);
BOOST_FOREACH(const Dictionary::Pair& kv, comments) {
ids.push_back(kv.first);
}
}
BOOST_FOREACH(const String& id, ids) {