# HG changeset patch # User Dremov Kirill (Nokia-D-MSW/Tampere) # Date 1274958114 -10800 # Node ID b69e63ed190200102d14bc73893148b7e11d47f4 # Parent 5e5528a288fef792168b095adbfa021ee6a318a2 Revision: 201021 Kit: 2010121 diff -r 5e5528a288fe -r b69e63ed1902 atext/server/group/extsrv.mmp --- a/atext/server/group/extsrv.mmp Fri May 14 16:59:23 2010 +0300 +++ b/atext/server/group/extsrv.mmp Thu May 27 14:01:54 2010 +0300 @@ -47,7 +47,7 @@ EPOCSTACKSIZE 0x5000 // Hack for plugins using RCmManager; remove this line when RCmManager becomes client-server EPOCHEAPSIZE 0x1000 0x2000000 // Use same as MCE -CAPABILITY CAP_SERVER NetworkControl CommDD +CAPABILITY CAP_SERVER NetworkControl CommDD PowerMgmt VENDORID VID_DEFAULT SOURCEPATH ../src diff -r 5e5528a288fe -r b69e63ed1902 atext/server/inc/atextcommonsession.h --- a/atext/server/inc/atextcommonsession.h Fri May 14 16:59:23 2010 +0300 +++ b/atext/server/inc/atextcommonsession.h Thu May 27 14:01:54 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2008 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" @@ -253,7 +253,7 @@ /** * Session to ECOM */ - REComSession iEComSession; + REComSession* iEComSession; /** * Instance of plugin diff -r 5e5528a288fe -r b69e63ed1902 atext/server/inc/atextsession.h --- a/atext/server/inc/atextsession.h Fri May 14 16:59:23 2010 +0300 +++ b/atext/server/inc/atextsession.h Thu May 27 14:01:54 2010 +0300 @@ -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" @@ -418,7 +418,7 @@ /** * Session to ECOM */ - REComSession iEComSession; + REComSession* iEComSession; /** * ECOM listener diff -r 5e5528a288fe -r b69e63ed1902 atext/server/src/atextcommonsession.cpp --- a/atext/server/src/atextcommonsession.cpp Fri May 14 16:59:23 2010 +0300 +++ b/atext/server/src/atextcommonsession.cpp Thu May 27 14:01:54 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2008 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" @@ -11,7 +11,7 @@ * * Contributors: * -* Description: +* Description: * */ @@ -132,6 +132,7 @@ CATExtCommonSession::CATExtCommonSession( CATExtSrvCommon& aServer, const TVersion& aVersion ) : iServer( aServer ), + iEComSession( NULL ), iVersion( aVersion ) { } @@ -158,13 +159,12 @@ TRACE_FUNC_EXIT User::Leave( retTemp ); } - REComSession& ecomSession = REComSession::OpenL(); - CleanupClosePushL( ecomSession ); + iEComSession = &REComSession::OpenL(); RImplInfoPtrArray implementations; CleanupResetDestroyClosePushL( implementations ); TUid ifUid = TUid::Uid( ATEXT_INTERFACE_COM_UID ); - iEComSession.ListImplementationsL( ifUid, - implementations ); + iEComSession->ListImplementationsL( ifUid, + implementations ); if ( implementations.Count() != 1 ) { TRACE_FUNC_EXIT @@ -173,9 +173,7 @@ TUid pluginUid = implementations[0]->ImplementationUid(); iCommonBase = CATExtCommonBase::NewL( pluginUid, *this, connectionName ); CleanupStack::PopAndDestroy( &implementations ); - CleanupStack::Pop( &ecomSession ); CleanupStack::PopAndDestroy( &connectionName ); - iEComSession = ecomSession; TRACE_FUNC_EXIT } @@ -488,7 +486,10 @@ } delete iCommonBase; iCommonBase = NULL; - iEComSession.Close(); + if ( iEComSession ) + { + iEComSession->Close(); + } if ( !aSyncClose ) { REComSession::FinalClose(); diff -r 5e5528a288fe -r b69e63ed1902 atext/server/src/atextsession.cpp --- a/atext/server/src/atextsession.cpp Fri May 14 16:59:23 2010 +0300 +++ b/atext/server/src/atextsession.cpp Thu May 27 14:01:54 2010 +0300 @@ -199,6 +199,7 @@ // CATExtSession::CATExtSession( CATExtSrv& aServer, const TVersion& aVersion ) : iServer( aServer ), + iEComSession( NULL ), iListener( NULL ), iMetadata( NULL ), iVersion( aVersion ) @@ -217,8 +218,7 @@ TRACE_FUNC_EXIT User::Leave( KErrGeneral ); } - REComSession& ecomSession = REComSession::OpenL(); - CleanupClosePushL( ecomSession ); + iEComSession = &REComSession::OpenL(); TPckgBuf ifUidPckgBuf; TInt retTemp = ReadStructFromMessage( ifUidPckgBuf, EATExtConnectParamUid, @@ -239,10 +239,10 @@ User::Leave( retTemp ); } // Create listener - CATExtListen* listener = CATExtListen::NewLC( ecomSession, this ); + CATExtListen* listener = CATExtListen::NewLC( *iEComSession, this ); listener->AddInterfaceUid( ifUidPckgBuf() ); // Create metadata. Pass iListener to add the UIDs - CATExtMetadata* metadata = CATExtMetadata::NewLC( ecomSession, + CATExtMetadata* metadata = CATExtMetadata::NewLC( *iEComSession, listener, *this ); metadata->CreateImplementationMetadataL( ifUidPckgBuf(), connectionName ); @@ -250,8 +250,6 @@ CleanupStack::Pop( metadata ); CleanupStack::Pop( listener ); CleanupStack::PopAndDestroy( &connectionName ); - CleanupStack::Pop( &ecomSession ); - iEComSession = ecomSession; iListener = listener; iMetadata = metadata; TRACE_FUNC_EXIT @@ -897,7 +895,10 @@ iListener = NULL; delete iMetadata; iMetadata = NULL; - iEComSession.Close(); + if ( iEComSession ) + { + iEComSession->Close(); + } if ( !aSyncClose ) { REComSession::FinalClose();