summaryrefslogtreecommitdiff
path: root/cpp/src
diff options
context:
space:
mode:
authorKen Giusti <kgiusti@apache.org>2012-05-25 18:30:48 +0000
committerKen Giusti <kgiusti@apache.org>2012-05-25 18:30:48 +0000
commitc498e2ec000f54bd134cffa3ca4aa0cd443b9b7f (patch)
tree308c112c3937c1604de6936d414c06b98c2d556a /cpp/src
parent9e0ed320e420f027f7d631c357b0b44315fd39aa (diff)
downloadqpid-python-c498e2ec000f54bd134cffa3ca4aa0cd443b9b7f.tar.gz
NO-JIRA: eliminate dead code and potential null pointer dereference as found by Coverity
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1342759 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src')
-rw-r--r--cpp/src/qpid/broker/Link.cpp42
1 files changed, 19 insertions, 23 deletions
diff --git a/cpp/src/qpid/broker/Link.cpp b/cpp/src/qpid/broker/Link.cpp
index ab28c5b01f..e354b4e425 100644
--- a/cpp/src/qpid/broker/Link.cpp
+++ b/cpp/src/qpid/broker/Link.cpp
@@ -345,36 +345,32 @@ void Link::opened() {
void Link::closed(int, std::string text)
{
- bool isClosing = false;
- {
- Mutex::ScopedLock mutex(lock);
- QPID_LOG (info, "Inter-broker link disconnected from " << host << ":" << port << " " << text);
+ Mutex::ScopedLock mutex(lock);
+ QPID_LOG (info, "Inter-broker link disconnected from " << host << ":" << port << " " << text);
- connection = 0;
- if (state == STATE_OPERATIONAL) {
+ connection = 0;
+
+ if (!hideManagement()) {
+ mgmtObject->set_connectionRef(qpid::management::ObjectId());
+ if (state == STATE_OPERATIONAL && agent) {
stringstream addr;
addr << host << ":" << port;
- if (!hideManagement() && agent)
- agent->raiseEvent(_qmf::EventBrokerLinkDown(addr.str()));
+ agent->raiseEvent(_qmf::EventBrokerLinkDown(addr.str()));
}
+ }
- for (Bridges::iterator i = active.begin(); i != active.end(); i++) {
- (*i)->closed();
- created.push_back(*i);
- }
- active.clear();
+ for (Bridges::iterator i = active.begin(); i != active.end(); i++) {
+ (*i)->closed();
+ created.push_back(*i);
+ }
+ active.clear();
- if (state != STATE_FAILED && state != STATE_PASSIVE)
- {
- setStateLH(STATE_WAITING);
- if (!hideManagement())
- mgmtObject->set_lastError (text);
- }
- mgmtObject->set_connectionRef(qpid::management::ObjectId());
+ if (state != STATE_FAILED && state != STATE_PASSIVE)
+ {
+ setStateLH(STATE_WAITING);
+ if (!hideManagement())
+ mgmtObject->set_lastError (text);
}
- // Call destroy outside of the lock, don't want to be deleted with lock held.
- if (isClosing)
- destroy();
}
// Called in connection IO thread, cleans up the connection before destroying Link