qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From g...@apache.org
Subject svn commit: r1197218 - /qpid/trunk/qpid/cpp/src/qpid/broker/Connection.cpp
Date Thu, 03 Nov 2011 16:53:51 GMT
Author: gsim
Date: Thu Nov  3 16:53:51 2011
New Revision: 1197218

URL: http://svn.apache.org/viewvc?rev=1197218&view=rev
Log:
QPID-3553: prevent multiple connection-tune-ok controls from leaving dangling pointers in
timer

Modified:
    qpid/trunk/qpid/cpp/src/qpid/broker/Connection.cpp

Modified: qpid/trunk/qpid/cpp/src/qpid/broker/Connection.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/broker/Connection.cpp?rev=1197218&r1=1197217&r2=1197218&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/broker/Connection.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/broker/Connection.cpp Thu Nov  3 16:53:51 2011
@@ -443,10 +443,14 @@ void Connection::setHeartbeatInterval(ui
 {
     setHeartbeat(heartbeat);
     if (heartbeat > 0 && !isShadow()) {
-        heartbeatTimer = new ConnectionHeartbeatTask(heartbeat, timer, *this);
-        timer.add(heartbeatTimer);
-        timeoutTimer = new ConnectionTimeoutTask(heartbeat, timer, *this);
-        timer.add(timeoutTimer);
+        if (!heartbeatTimer) {
+            heartbeatTimer = new ConnectionHeartbeatTask(heartbeat, timer, *this);
+            timer.add(heartbeatTimer);
+        }
+        if (!timeoutTimer) {
+            timeoutTimer = new ConnectionTimeoutTask(heartbeat, timer, *this);
+            timer.add(timeoutTimer);
+        }
     }
 }
 



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:commits-subscribe@qpid.apache.org


Mime
View raw message