vtengines/vtmediatorplugin/src/cvtmediatorplugin.cpp
branchRCL_3
changeset 12 3e521e99f813
parent 3 b1602a5ab0a3
child 24 f15ac8e65a02
--- a/vtengines/vtmediatorplugin/src/cvtmediatorplugin.cpp	Mon Mar 15 12:40:49 2010 +0200
+++ b/vtengines/vtmediatorplugin/src/cvtmediatorplugin.cpp	Wed Mar 31 21:35:06 2010 +0300
@@ -154,8 +154,6 @@
         {
         delete iAppDeathActive;
         iAppThread.Close();
-        iWsSession.Close();
-        
         }
 
     TRACE("CVtMediatorPlugin::~CVtMediatorPlugin>")
@@ -528,7 +526,9 @@
 
     iAppDeathActive = new ( ELeave ) CAppDeathActive( *this, iAppThread );
        
-    User::LeaveIfError( iWsSession.Connect() );
+    RWsSession wsSession;
+    User::LeaveIfError( wsSession.Connect() );
+    CleanupClosePushL( wsSession );
 
     TInt wgId = 0;
     TBool found = EFalse;
@@ -539,10 +539,10 @@
         {
         CApaWindowGroupName::FindByAppUid( 
             KVtCmVideoTelUiUid, 
-            iWsSession, 
+            wsSession, 
             wgId );
 
-        TApaTask task( iWsSession );
+        TApaTask task( wsSession );
         task.SetWgId( wgId );
         if ( task.Exists() )
             {
@@ -563,7 +563,8 @@
             iAppThread.Close();
              }
         }
-
+    CleanupStack::PopAndDestroy(); // CleanupClosePushL
+    
     // If application was not found, then launch new application.
     if ( !found )
         {
@@ -931,7 +932,6 @@
     TRACE("CVtMediatorPlugin.StopDeathActive<")
     delete iAppDeathActive;
     iAppThread.Close();
-    iWsSession.Close();
     //if there is a waiting call, check if we need to launch it
     TRACE2("CVtMediatorPlugin.StopDeathActive WaitintCallID=%d>",
             iWaitingVideoCallInfo.iCallId)