summaryrefslogtreecommitdiff
path: root/qpid/cpp/src
diff options
context:
space:
mode:
authorKenneth Anthony Giusti <kgiusti@apache.org>2011-12-07 21:55:13 +0000
committerKenneth Anthony Giusti <kgiusti@apache.org>2011-12-07 21:55:13 +0000
commitbdb2f5654c135376180a8453539492420a35453f (patch)
tree490781b2f92ab7c855db5abfa77f4561513292d2 /qpid/cpp/src
parent80162c026691899a7c2fd9c0b73072185797dacc (diff)
downloadqpid-python-bdb2f5654c135376180a8453539492420a35453f.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@1211660 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/src')
-rw-r--r--qpid/cpp/src/qpid/management/ManagementAgent.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/qpid/cpp/src/qpid/management/ManagementAgent.cpp b/qpid/cpp/src/qpid/management/ManagementAgent.cpp
index b2a039d1fa..ff5271f83b 100644
--- a/qpid/cpp/src/qpid/management/ManagementAgent.cpp
+++ b/qpid/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;
}