[asterisk-scf-commits] asterisk-scf/release/sip.git branch "master" updated.

Commits to the Asterisk SCF project code repositories asterisk-scf-commits at lists.digium.com
Wed May 25 17:38:38 CDT 2011


branch "master" has been updated
       via  0e36a390c38355413afde6da286342f780a35a87 (commit)
      from  fb9f4f3a7b813ee52200427d9c544eccb439ea37 (commit)

Summary of changes:
 src/PJSipSessionModule.cpp |   30 +++++++-----------------------
 src/SipSession.cpp         |    5 ++++-
 2 files changed, 11 insertions(+), 24 deletions(-)


- Log -----------------------------------------------------------------
commit 0e36a390c38355413afde6da286342f780a35a87
Author: Brent Eagles <beagles at digium.com>
Date:   Wed May 25 20:06:13 2011 -0230

    Reordered deletion/assigment of 0 to PJSipSessionModInfo in the disconnect
    steps. Put a few more null pointer checks where this structure is used
    throughout. Thread safety is probably still and issue however.

diff --git a/src/PJSipSessionModule.cpp b/src/PJSipSessionModule.cpp
index 83cf223..57d5df6 100644
--- a/src/PJSipSessionModule.cpp
+++ b/src/PJSipSessionModule.cpp
@@ -77,9 +77,6 @@ PJSipSessionModInfo::PJSipSessionModInfo(pjsip_inv_session *inv_session,
 
 PJSipSessionModInfo::~PJSipSessionModInfo()
 {
-    //
-    // TODO : remove ourselves from the invite session's mod_data.
-    //
     if (mSession)
     {
         mSession->destroy();
@@ -1171,8 +1168,8 @@ protected:
             }
             lg(Debug) << "Replicating state on DISCONNECTED inv_state.";
             mSessionModule->replicateState(dlg_mod_info, NULL, session_mod_info);
-            delete session_mod_info;
             mInv->mod_data[mSessionModule->getModule().id] = 0;
+            delete session_mod_info;
             if (dlg_mod_info)
             {
                 delete dlg_mod_info;
@@ -1472,23 +1469,6 @@ pjsip_dialog *PJSipSessionModule::uaOnDialogForked(pjsip_dialog*, pjsip_rx_data*
     return NULL;
 }
 
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
 QueuePtr PJSipSessionModule::getThreadPoolQueue()
 {
     return mPoolQueue;
@@ -1498,8 +1478,12 @@ void PJSipSessionModule::enqueueSessionWork(const SuspendableWorkPtr& work, pjsi
 {
     PJSipSessionModInfo *session_mod_info =
         static_cast<PJSipSessionModInfo*>(inv->mod_data[mModule.id]);
-    SessionWorkPtr sessionWork = session_mod_info->getSessionWork();
-    sessionWork->enqueueWork(work);
+
+    if (session_mod_info)
+    {
+        SessionWorkPtr sessionWork = session_mod_info->getSessionWork();
+        sessionWork->enqueueWork(work);
+    }
 }
 
 PJSipSessionModuleThreadPoolListener::PJSipSessionModuleThreadPoolListener()
diff --git a/src/SipSession.cpp b/src/SipSession.cpp
index 940697d..63df653 100644
--- a/src/SipSession.cpp
+++ b/src/SipSession.cpp
@@ -136,7 +136,10 @@ public:
             PJSipSessionModInfo *session_mod_info =
                 static_cast<PJSipSessionModInfo*>(
                     mInviteSession->mod_data[mManager->getSessionModule()->getModule().id]);
-            session_mod_info->updateSessionState(mInviteSession);
+            if (session_mod_info)
+            {
+                session_mod_info->updateSessionState(mInviteSession);
+            }
             mManager->getSessionModule()->replicateState(NULL, NULL, session_mod_info);
         }
     }

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


-- 
asterisk-scf/release/sip.git



More information about the asterisk-scf-commits mailing list