qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kgiu...@apache.org
Subject svn commit: r1153966 - in /qpid/trunk/qpid/cpp/src/qpid/broker: SessionState.cpp SessionState.h
Date Thu, 04 Aug 2011 18:45:17 GMT
Author: kgiusti
Date: Thu Aug  4 18:45:16 2011
New Revision: 1153966

URL: http://svn.apache.org/viewvc?rev=1153966&view=rev
Log:
QPID-3394: move object copy after changing object state, not before.

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

Modified: qpid/trunk/qpid/cpp/src/qpid/broker/SessionState.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/broker/SessionState.cpp?rev=1153966&r1=1153965&r2=1153966&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/broker/SessionState.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/broker/SessionState.cpp Thu Aug  4 18:45:16 2011
@@ -445,8 +445,6 @@ void SessionState::addPendingExecutionSy
 boost::intrusive_ptr<AsyncCompletion::Callback>
 SessionState::IncompleteIngressMsgXfer::clone()
 {
-    boost::intrusive_ptr<SessionState::IncompleteIngressMsgXfer> cb(new SessionState::IncompleteIngressMsgXfer(session,
msg));
-
     // Optimization: this routine is *only* invoked when the message needs to be asynchronously
completed.
     // If the client is pending the message.transfer completion, flush now to force immediate
write to journal.
     if (requiresSync)
@@ -457,7 +455,8 @@ SessionState::IncompleteIngressMsgXfer::
         pending = true;
         completerContext->addPendingMessage(msg);
     }
-    return cb;
+
+    return boost::intrusive_ptr<SessionState::IncompleteIngressMsgXfer>(new SessionState::IncompleteIngressMsgXfer(*this));
 }
 
 

Modified: qpid/trunk/qpid/cpp/src/qpid/broker/SessionState.h
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/broker/SessionState.h?rev=1153966&r1=1153965&r2=1153966&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/broker/SessionState.h (original)
+++ qpid/trunk/qpid/cpp/src/qpid/broker/SessionState.h Thu Aug  4 18:45:16 2011
@@ -256,7 +256,15 @@ class SessionState : public qpid::Sessio
           requiresAccept(m->requiresAccept()),
           requiresSync(m->getFrames().getMethod()->isSync()),
           pending(false) {}
-        virtual ~IncompleteIngressMsgXfer() {};
+        IncompleteIngressMsgXfer( const IncompleteIngressMsgXfer& x )
+          : AsyncCommandContext(x.session, x.msg->getCommandId()),
+          session(x.session),
+          msg(x.msg),
+          requiresAccept(x.requiresAccept),
+          requiresSync(x.requiresSync),
+          pending(x.pending) {}
+
+  virtual ~IncompleteIngressMsgXfer() {};
 
         virtual void completed(bool);
         virtual boost::intrusive_ptr<AsyncCompletion::Callback> clone();



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


Mime
View raw message