diff options
Diffstat (limited to 'cpp/src/IceGrid/Database.cpp')
-rw-r--r-- | cpp/src/IceGrid/Database.cpp | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/cpp/src/IceGrid/Database.cpp b/cpp/src/IceGrid/Database.cpp index 02f3e7d87e4..aa4803f9269 100644 --- a/cpp/src/IceGrid/Database.cpp +++ b/cpp/src/IceGrid/Database.cpp @@ -516,7 +516,18 @@ Database::removeApplication(const string& name, AdminSessionI* session) // } - _applications.erase(p); + startUpdating(name); + } + + if(_master) + { + for_each(entries.begin(), entries.end(), IceUtil::voidMemFun(&ServerEntry::sync)); + for_each(entries.begin(), entries.end(), IceUtil::voidMemFun(&ServerEntry::waitNoThrow)); + } + + { + Lock sync(*this); + _applications.erase(name); ++_applicationSerial; serial = _applicationObserverTopic->applicationRemoved(_applicationSerial, name); @@ -528,13 +539,9 @@ Database::removeApplication(const string& name, AdminSessionI* session) } } - if(_master) - { - for_each(entries.begin(), entries.end(), IceUtil::voidMemFun(&ServerEntry::sync)); - for_each(entries.begin(), entries.end(), IceUtil::voidMemFun(&ServerEntry::waitNoThrow)); - } - _applicationObserverTopic->waitForSyncedSubscribers(serial); + + finishUpdating(name); } ApplicationInfo |