diff options
-rw-r--r-- | qpid/cpp/src/qpid/broker/DeliveryRecord.cpp | 7 | ||||
-rw-r--r-- | qpid/cpp/src/qpid/broker/Queue.cpp | 2 |
2 files changed, 4 insertions, 5 deletions
diff --git a/qpid/cpp/src/qpid/broker/DeliveryRecord.cpp b/qpid/cpp/src/qpid/broker/DeliveryRecord.cpp index d0a450ce1e..1f2b259689 100644 --- a/qpid/cpp/src/qpid/broker/DeliveryRecord.cpp +++ b/qpid/cpp/src/qpid/broker/DeliveryRecord.cpp @@ -113,14 +113,13 @@ void DeliveryRecord::complete() { /** Accept msg, and optionally notify caller when dequeue completes */ boost::intrusive_ptr<Queue::DequeueCompletion> DeliveryRecord::accept(TransactionContext* ctxt) { - static const boost::intrusive_ptr<Queue::DequeueCompletion> empty; + boost::intrusive_ptr<Queue::DequeueCompletion> dq; if (acquired && !ended) { QPID_LOG(debug, "Accepted " << id); - boost::intrusive_ptr<Queue::DequeueCompletion> dq(queue->dequeue(ctxt, msg)); + dq = queue->dequeue(ctxt, msg); setEnded(); - return dq; } - return empty; + return dq; } void DeliveryRecord::dequeue(TransactionContext* ctxt) const{ diff --git a/qpid/cpp/src/qpid/broker/Queue.cpp b/qpid/cpp/src/qpid/broker/Queue.cpp index 0520099d90..04d61c1add 100644 --- a/qpid/cpp/src/qpid/broker/Queue.cpp +++ b/qpid/cpp/src/qpid/broker/Queue.cpp @@ -659,7 +659,7 @@ void Queue::enqueueAborted(boost::intrusive_ptr<Message> msg) boost::intrusive_ptr<Queue::DequeueCompletion> Queue::dequeue(TransactionContext* ctxt, const QueuedMessage& msg) { - static const boost::intrusive_ptr<DequeueCompletion> empty; + boost::intrusive_ptr<DequeueCompletion> empty; ScopedUse u(barrier); if (!u.acquired) return empty; |