qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From g...@apache.org
Subject svn commit: r1485995 - in /qpid/trunk/qpid/cpp/src/qpid/broker: IngressCompletion.cpp IngressCompletion.h
Date Fri, 24 May 2013 10:24:39 GMT
Author: gsim
Date: Fri May 24 10:24:38 2013
New Revision: 1485995

URL: http://svn.apache.org/r1485995
Log:
QPID-4859: prevent circular reference on queues still holding durable messages

Modified:
    qpid/trunk/qpid/cpp/src/qpid/broker/IngressCompletion.cpp
    qpid/trunk/qpid/cpp/src/qpid/broker/IngressCompletion.h

Modified: qpid/trunk/qpid/cpp/src/qpid/broker/IngressCompletion.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/broker/IngressCompletion.cpp?rev=1485995&r1=1485994&r2=1485995&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/broker/IngressCompletion.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/broker/IngressCompletion.cpp Fri May 24 10:24:38 2013
@@ -39,7 +39,10 @@ void IngressCompletion::flush()
         queues.swap(copy);
     }
     for (Queues::const_iterator i = copy.begin(); i != copy.end(); ++i) {
-        (*i)->flush();
+        boost::shared_ptr<Queue> q(i->lock());
+        if (q) {
+            q->flush();
+        }
     }
 }
 }} // namespace qpid::broker

Modified: qpid/trunk/qpid/cpp/src/qpid/broker/IngressCompletion.h
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/broker/IngressCompletion.h?rev=1485995&r1=1485994&r2=1485995&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/broker/IngressCompletion.h (original)
+++ qpid/trunk/qpid/cpp/src/qpid/broker/IngressCompletion.h Fri May 24 10:24:38 2013
@@ -24,6 +24,7 @@
 #include "AsyncCompletion.h"
 #include "qpid/sys/Mutex.h"
 #include <boost/shared_ptr.hpp>
+#include <boost/weak_ptr.hpp>
 #include <vector>
 
 namespace qpid {
@@ -42,7 +43,7 @@ class IngressCompletion : public AsyncCo
     void enqueueAsync(boost::shared_ptr<Queue>);
     void flush();
   private:
-    typedef std::vector<boost::shared_ptr<Queue> > Queues;
+    typedef std::vector<boost::weak_ptr<Queue> > Queues;
     Queues queues;
     qpid::sys::Mutex lock;
 };



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


Mime
View raw message