connectivitymodules/SeCon/services/pcd/src/sconvideoparser.cpp
branchRCL_3
changeset 1 f8e15b44d440
parent 0 d0791faffa3f
child 13 81da3301b632
--- a/connectivitymodules/SeCon/services/pcd/src/sconvideoparser.cpp	Tue Feb 02 01:11:40 2010 +0200
+++ b/connectivitymodules/SeCon/services/pcd/src/sconvideoparser.cpp	Fri Feb 19 23:40:44 2010 +0200
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
 * All rights reserved.
 * This component and the accompanying materials are made available
 * under the terms of "Eclipse Public License v1.0"
@@ -57,6 +57,13 @@
         iVideoUtil->Close();
         }
     delete iVideoUtil;
+    
+    if ( iWindow )
+        {
+        iWindow->Close();
+        }
+    delete iWindow;
+    iRootWindow.Close();
     delete iScreen;
     iWsSession.Close();
     
@@ -90,26 +97,16 @@
     User::LeaveIfError( iWsSession.Connect() );
     
     iScreen = new(ELeave) CWsScreenDevice( iWsSession );
-    iScreen->Construct();
-    
-    RWindowGroup wg( iWsSession );
-    User::LeaveIfError( wg.Construct(reinterpret_cast<TUint32>(&wg), EFalse) );
-    CleanupClosePushL( wg );
+    User::LeaveIfError( iScreen->Construct() );
     
-    CWindowGc* gc;
-    User::LeaveIfError( iScreen->CreateContext(gc) );
-    CleanupStack::PushL(gc);
+    iRootWindow = RWindowGroup(iWsSession);
+    User::LeaveIfError( iRootWindow.Construct(reinterpret_cast<TUint32>(&iWsSession), EFalse) );
     
-    RWindow window( iWsSession );
-    User::LeaveIfError( window.Construct(wg, reinterpret_cast<TUint32>(&wg) + 1) );
-    CleanupClosePushL( window );
+    iWindow = new(ELeave) RWindow( iWsSession );
+    User::LeaveIfError( iWindow->Construct(iRootWindow, reinterpret_cast<TUint32>(&iRootWindow) + 1) );
     
     TRect temp(0,0,320,240); // dummy parameter
-    iVideoUtil = CVideoPlayerUtility::NewL(*this, EMdaPriorityNormal, EMdaPriorityPreferenceNone, iWsSession, *(iScreen), window, temp, temp);
-    
-    CleanupStack::PopAndDestroy( &window );
-    CleanupStack::PopAndDestroy( gc );
-    CleanupStack::PopAndDestroy( &wg );
+    iVideoUtil = CVideoPlayerUtility::NewL(*this, EMdaPriorityNormal, EMdaPriorityPreferenceNone, iWsSession, *iScreen, *iWindow, temp, temp);
     
     iTimeOut = CSconTimeOut::NewL( *this );