diff options
author | Kenneth Anthony Giusti <kgiusti@apache.org> | 2011-12-07 21:55:13 +0000 |
---|---|---|
committer | Kenneth Anthony Giusti <kgiusti@apache.org> | 2011-12-07 21:55:13 +0000 |
commit | 36eac9afa717fc85e92964de4271b3b46880e1a0 (patch) | |
tree | 4236e676e774f696f9fbee3396371fca86076ce7 /cpp/src | |
parent | 49346a8c7b6017f4fed65171d4e109cbf769bf80 (diff) | |
download | qpid-python-36eac9afa717fc85e92964de4271b3b46880e1a0.tar.gz |
QPID-3666: replace both the index and the value when updating duplicate objects
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1211660 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src')
-rw-r--r-- | cpp/src/qpid/management/ManagementAgent.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/cpp/src/qpid/management/ManagementAgent.cpp b/cpp/src/qpid/management/ManagementAgent.cpp index b2a039d1fa..ff5271f83b 100644 --- a/cpp/src/qpid/management/ManagementAgent.cpp +++ b/cpp/src/qpid/management/ManagementAgent.cpp @@ -684,7 +684,7 @@ void ManagementAgent::moveNewObjectsLH() ManagementObjectMap::iterator destIter = managementObjects.find(oid); if (destIter != managementObjects.end()) { // duplicate found. It is OK if the old object has been marked - // deleted... + // deleted, just replace the old with the new. ManagementObject *oldObj = destIter->second; if (oldObj->isDeleted()) { DeletedObject::shared_ptr dptr(new DeletedObject(oldObj, qmf1Support, qmf2Support)); @@ -696,6 +696,10 @@ void ManagementAgent::moveNewObjectsLH() // and complain loudly... QPID_LOG(error, "Detected two management objects with the same identifier: " << oid); } + // QPID-3666: be sure to replace the -index- also, as non-key members of + // the index object may be different for the new object! So erase the + // entry, rather than []= assign here: + managementObjects.erase(destIter); } managementObjects[oid] = object; } |