mmserv/tms/tmsimpl/src/tmsipcallbodyimpl.cpp
branchRCL_3
changeset 20 0ac9a5310753
parent 19 095bea5f582e
--- a/mmserv/tms/tmsimpl/src/tmsipcallbodyimpl.cpp	Tue Aug 31 15:43:02 2010 +0300
+++ b/mmserv/tms/tmsimpl/src/tmsipcallbodyimpl.cpp	Wed Sep 01 12:23:00 2010 +0100
@@ -68,38 +68,37 @@
     TRACE_PRN_FN_ENT;
     iSession = new TMSCallProxy();
 
-    TRACE_PRN_FN_ENT;
-    if (!iSession)
-        {
-        ret = TMS_RESULT_INSUFFICIENT_MEMORY;
-        }
-    RET_REASON_IF_ERR(ret);
-
-    if (iSession->Connect() != TMS_RESULT_SUCCESS)
+    if (iSession)
         {
-        delete iSession;
-        iSession = NULL;
-        ret = TMS_RESULT_FATAL_ERROR;
-        }
-    else
-        {
-        ret = iSession->CreateCall(TMS_CALL_IP);
-        if (ret != TMS_RESULT_SUCCESS && ret != TMS_RESULT_ALREADY_EXIST)
+        if (iSession->Connect() != TMS_RESULT_SUCCESS)
             {
-            iSession->Close();
             delete iSession;
             iSession = NULL;
             ret = TMS_RESULT_FATAL_ERROR;
             }
+        else
+            {
+            ret = iSession->CreateCall(TMS_CALL_IP);
+            if (ret != TMS_RESULT_SUCCESS && ret != TMS_RESULT_ALREADY_EXIST)
+                {
+                iSession->Close();
+                delete iSession;
+                ret = TMS_RESULT_FATAL_ERROR;
+                }
+            }
         }
-    RET_REASON_IF_ERR(ret);
+    else
+        {
+        ret = TMS_RESULT_INSUFFICIENT_MEMORY;
+        }
     TRACE_PRN_FN_EXT;
     return ret;
     }
 
 TMSCallType TMSIPCallBodyImpl::GetCallType()
     {
-    return TMS_CALL_IP;
+    TMSCallType ctype(TMS_CALL_IP);
+    return ctype;
     }
 
 gint TMSIPCallBodyImpl::GetCallContextId(guint& ctxid)
@@ -128,7 +127,7 @@
                 ret = AddStreamToList(strm);
                 }
             //TODO:Need longer term fix to not destory everything
-            //if more than one stream is trying to be created.
+            //if more the one stream is trying to be created.
             else if (ret == TMS_RESULT_ALREADY_EXIST)
                 {
                 break;
@@ -194,10 +193,9 @@
 
     if (itStrm)
         {
-        // Remove stream object from the vector. After removing, the iterator
-        // will point to the next item (if available); so, do NOT attempt
-        // deleting itStrm here! (Will result in KERN-EXEC)
         iStreamsVector.erase(itStrm); // Remove from array
+        // Don't delete itStrm as the iterator advanced to the next
+        // item on the list
         ret = TMSStreamImpl::Delete(strm);
         }
     TRACE_PRN_FN_EXT;