QPID-3079: remove static locals

git-svn-id: https://svn.apache.org/repos/asf/qpid/branches/qpid-3079@1137022 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/qpid/cpp/src/qpid/broker/DeliveryRecord.cpp b/qpid/cpp/src/qpid/broker/DeliveryRecord.cpp
index d0a450c..1f2b259 100644
--- a/qpid/cpp/src/qpid/broker/DeliveryRecord.cpp
+++ b/qpid/cpp/src/qpid/broker/DeliveryRecord.cpp
@@ -113,14 +113,13 @@
 /** 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 0520099..04d61c1 100644
--- a/qpid/cpp/src/qpid/broker/Queue.cpp
+++ b/qpid/cpp/src/qpid/broker/Queue.cpp
@@ -659,7 +659,7 @@
 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;