summaryrefslogtreecommitdiff
path: root/cpp/src
diff options
context:
space:
mode:
authorKen Giusti <kgiusti@apache.org>2011-12-07 21:55:13 +0000
committerKen Giusti <kgiusti@apache.org>2011-12-07 21:55:13 +0000
commit31fb207565f1a3abc635f323c4957b792ab32b56 (patch)
tree4236e676e774f696f9fbee3396371fca86076ce7 /cpp/src
parent74d70eedffd861579cc3f1f0b13b7ab3db8fb93d (diff)
downloadqpid-python-31fb207565f1a3abc635f323c4957b792ab32b56.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.cpp6
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;
}