[asterisk-scf-commits] asterisk-scf/integration/routing.git branch "master" updated.

Commits to the Asterisk SCF project code repositories asterisk-scf-commits at lists.digium.com
Wed Oct 20 15:22:17 CDT 2010


branch "master" has been updated
       via  21d2b2dbb486a0552c4264016135cc2156fe8b3b (commit)
      from  29002b549efa656c4c283fe05f018ac6c1516fdd (commit)

Summary of changes:
 src/SessionRouter.cpp |   29 ++++++++++++++++++-----------
 1 files changed, 18 insertions(+), 11 deletions(-)


- Log -----------------------------------------------------------------
commit 21d2b2dbb486a0552c4264016135cc2156fe8b3b
Author: Ken Hunt <ken.hunt at digium.com>
Date:   Wed Oct 20 15:21:03 2010 -0500

    Moved adding the listener to the object adapter outside of its
    constructor.

diff --git a/src/SessionRouter.cpp b/src/SessionRouter.cpp
index b513020..88ada7e 100644
--- a/src/SessionRouter.cpp
+++ b/src/SessionRouter.cpp
@@ -41,22 +41,11 @@ public:
     SessionListenerImpl(Ice::ObjectAdapterPtr adapter, const SessionPrx& session) : 
         mAdapter(adapter), mTerminated(false), mListenerPrx(0)
     {
-        Ice::ObjectPrx prx = adapter->addWithUUID(this);
-        mListenerPrx = SessionListenerPrx::checkedCast(prx);
-
-        addSessionAndListen(session);
     }
 
     SessionListenerImpl(Ice::ObjectAdapterPtr adapter, SessionSeq& sessionSequence) : 
         mAdapter(adapter), mTerminated(false), mListenerPrx(0)
     {
-        Ice::ObjectPrx prx = adapter->addWithUUID(this);
-        mListenerPrx = SessionListenerPrx::checkedCast(prx);
-
-        for(SessionSeq::iterator s = sessionSequence.begin(); s != sessionSequence.end(); ++s)
-        {
-           addSessionAndListen(*s);
-        }
     }
 
     ~SessionListenerImpl()
@@ -197,6 +186,11 @@ public:
         return mListenerPrx;
     }
 
+    void setProxy(const SessionListenerPrx& prx)
+    {
+        mListenerPrx = prx;
+    }
+
 private:
     boost::shared_mutex mLock;
 
@@ -219,12 +213,25 @@ public:
         : mSessionListener(new SessionListenerImpl(adapter, session)),
           mAdapter(adapter)
     {
+        Ice::ObjectPrx prx = adapter->addWithUUID(mSessionListener);
+        SessionListenerPrx listenerProxy = SessionListenerPrx::checkedCast(prx);
+        mSessionListener->setProxy(listenerProxy);
+
+        mSessionListener->addSessionAndListen(session);
     }
 
     SessionListenerAllocator(Ice::ObjectAdapterPtr adapter, SessionSeq& sessionSequence) 
         : mSessionListener(new SessionListenerImpl(adapter, sessionSequence)),
           mAdapter(adapter)
     {
+        Ice::ObjectPrx prx = adapter->addWithUUID(mSessionListener);
+        SessionListenerPrx listenerProxy = SessionListenerPrx::checkedCast(prx);
+        mSessionListener->setProxy(listenerProxy);
+
+        for(SessionSeq::iterator s = sessionSequence.begin(); s != sessionSequence.end(); ++s)
+        {
+           mSessionListener->addSessionAndListen(*s);
+        }
     }
 
     ~SessionListenerAllocator()

-----------------------------------------------------------------------


-- 
asterisk-scf/integration/routing.git



More information about the asterisk-scf-commits mailing list